Alex Marshall Alex Marshall is a marketeer, web developer and designer. He also likes retro technology, classic cars and in his spare time enjoys travelling.

Why your API needs web services

1 min read

A few days ago an interesting query was raised by one of our customers.

They queried whether it was possible for us to write our PDF2HTML5 Java api in dot net languages or php (Hypertext Preprocessor).

According to my colleague Suda, as many of you may be aware integrating the Java api into dot net frameworks consumes a considerable amount of time.

In order to answer this query we have decided to provide a PDF to HTML5 Cloud based design solution in our products using web services in order to fulfil our client’s demands.

This encouraged us to move to jax-ws plugins in our online conversion tool.
Now this has resulted in the conversion process becoming much more simpler than we imagined and our tool started helping all the other programming languages and platforms.

//jax-ws subroutine implementation
public byte[] convert
(@WebParam(name = “email”) String email,
@WebParam(name = “password”) String password,
@WebParam(name = “fileName”) String fileName,
@WebParam(name = “dataByteArray”) byte[] byteDataArray,
@WebParam(name = “conversionType”) String conversionType,
@WebParam(name = “conversionParams”) String[] conversionParams,
@WebParam(name = “xmlParamsByteArray”) byte[] xmlParamsByteArray,
@WebParam(name = “isDebugMode”) boolean isDebugMode) {
……………………………………………………….}

Since this method is stateless session we stopped worrying about multiple client request and security threads.

The wsdl for this service can be found at:

http://glassfish.idrsolutions.com:8282/HTML_Page_Extraction/IDRConversionService?wsdl

Feel free to try this out (It is free to use at the moment).

An example of the usage:
email: clouduser
password; pdf
fileName: {your pdf file name eg: myfile.pdf}
byteDataArray: {your pdf file data in bytes}
conversionType: html5
conversionParams: null;(if you like more additional styling you can try our jvm options as string array http://www.idrsolutions.com/html5-jvm-options/).
xmlParamsByteArray: null;
isDebugMode: false (make it true if you find your conversion returns null data and if it is set to true then you will obtain a string bytes of error messages which describes why your conversion was failed);

As an outcome of this method you will be able to obtain bytes array of a zipped file which contains the html converted data and directory hierarchy of the converted data.

This post is part of our “GlassFish Articles Index” series. In these articles, we aim to explore GlassFish in different ways, from useful tutorials, to JaveOne and general.

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Alex Marshall Alex Marshall is a marketeer, web developer and designer. He also likes retro technology, classic cars and in his spare time enjoys travelling.

Why we wrote our own Java jpeg2000 libraries

JPEG2000 is an important image file format which offers significant benefits over JPEG. For our specific usage it does generate significantly smaller file sizes...
Mark Stephens
52 sec read

How to choose JPG versus JPEG2000 for image files

Since we started to support both JPG and JPG2000 as image file outputs in our software, we have found that this is a very...
Mark Stephens
1 min read

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.