Created
October 13, 2022 07:14
How to Convert PDF to HTML in Java. For more information, please follow link: https://kb.conholdate.com/total/java/how-to-convert-pdf-to-html-in-java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.groupdocs.conversion.Converter; | |
import com.groupdocs.conversion.licensing.License; | |
import com.groupdocs.conversion.options.convert.MarkupConvertOptions; | |
public class ConvertPdfToHtmlInJava { | |
public static void main(String[] args) { // Main function to convert PDF to HTML in Java | |
// Remove the watermark in output HTML file by adding license | |
License lic = new License(); | |
lic.setLicense("/path/to/GroupDocs.Conversion.lic"); | |
// Load the source PDF file for conversion to HTML | |
Converter converter = new Converter("/path/to/sample.pdf"); | |
// Set the convert options for HTML format | |
MarkupConvertOptions options = new MarkupConvertOptions(); | |
// Convert and save the PDF in HTML format | |
converter.convert("/path/to/converted.html", options); | |
System.out.println("Done"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment