How to PDF to HTML in Java using Cloud API (low level) - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

How to PDF to HTML in Java using Cloud API (low level)

  • Home
  • /
  • Articles
  • /
  • How to PDF to HTML in Java using Cloud API (low level)

This tutorial will show you how to convert PDF to HTML in Java using ByteScout Cloud API.

It is also possible to convert HTML to PDF using Cloud API.

POST/GET endpoint:

https://api.pdf.co/v1/pdf/convert/to/html

Code Sample:

import Bytescout\Client\API.*;
import Bytescout\Client\API.auth.*;
import Bytescout\Client\API.model.*;
import Bytescout\Client\API.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: api_key
        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
        api_key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //api_key.setApiKeyPrefix("Token");

        DefaultApi apiInstance = new DefaultApi();
        String simple = simple_example; // String | Set 'true' to convert to a plain HTML format. Default is the rich HTML & CSS format keeping the document design.
        String columns = columns_example; // String | Set 'true' if the PDF document is arranged in columns like a newspaper. Default is 'false'.
        String url = url_example; // String | URL of the source PDF file.
        String name = name_example; // String | File name for generated result.
        try {
            SingleResponseModel result = apiInstance.pdfConvertToHtmlPost(simple, columns, url, name);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#pdfConvertToHtmlPost");
            e.printStackTrace();
        }
    }
}

Tutorials:

prev
next