I suggest Aspose.Words Cloud SDK for Java. It supports PDF to HTML conversion along with other file format conversions. It is a paid product. However, the free trial plan offers 150 monthly API calls. //Get Client ID and Client Key from https.//dashboard.aspose.cloud/ WordsApi wordsApi = new WordsApi("xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxx","https.//api.aspose.cloud"); ApiClient client = wordsApi.getApiClient ; client.setConnectTimeout(12*60*1000); client.setReadTimeout(12*60*1000); client.setWriteTimeout(12*60*1000); try { ConvertDocumentRequest request = new ConvertDocumentRequest( Files.readAllBytes(Paths.get("C./Temp/02_pages.pdf").toAbsolutePath ), "html", null, null, null, null ); File result = wordsApi.convertDocument(request); System.out.println("api request completed..."); File dest = new File("C./Temp/02_pages_java.html"); Files.copy(result.toPath , dest.toPath , java.nio.file.StandardCopyOption.REPLACE_EXISTING); } catch (Exception e) { System.out.println(e.getMessage ); }
Out.print(“File conversion failed!”);} finally {//Reactivate the API for the next client. Client.connector(words.connectToAPI(C. ApiKey, C. ApiClient));} } catch (Exception e) {e.printStackTrace();} //Return to the Dashboard. After that simply click on “Send files” and then “Send document” and it will send the file to your email, or you can save it or something like that. Then send that to someone, and then you can see it there, and they should get it. I'm using Appose for the last 15 years. No other product works for me, it's simply amazing how it works. If you would like to support the developer it is more than worth a try.