Free Support Forum -

Convert a HTML file to PDF programmatically using Java

Can Group docs convert a html (remote website or hosted remotely) along with css + fonts + JS to pdf?

Usually, page contains lot of dynamic data loaded by JS. We need to convert pdf of the page once all the dom (and dom loaded/mainipulated by JS) loading is complete.


Thank you for your inquiry.
Please note that GroupDocs.Conversion API takes a HTML file as input and then converts it to PDF or any other supported document. You can pass a local HTML file path or remote file path
String guid = "";

Do you mean that you want to convert a complete remote or hosted HTML website (along-with all of its web pages) into PDF by just passing the website URL? Can you please further elaborate this use-case?

Partly correct. If we give URL, it should convert that html page into pdf (including dynamically rendered DOM by javascript), example : home page


No, actually API gets HTML file from the URL (if there is a file located). For instance in the given path:
String guid = "";

However, we are further investigating the scenario, your investigation ticket ID is CONVERSIONJAVA-523. As we have any update, we’ll update you.