In this tutorial I will guide you on how you can convert fillable PDF forms to HTML forms using various methods using a few simple lines of code. Converting to HTML forms has many benefits, including allowing your forms to be optimised for the web and giving you greater flexibility with the HTML code.
How to convert fillable PDF forms to HTML forms using Java
- Download the FormVu trial jar
- Add the FormVu Jar to your project libraries
- Choose conversion options
- Choose viewer options
- Set PDF file path and output directory
HTMLConversionOptions conversionOptions = new HTMLConversionOptions();
// Set conversion options here e.g. conversionOptions.setImageScale(1.2f);
FormViewerOptions viewerOptions = new FormViewerOptions();
// Set FormViewer options here e.g. viewerOptions.setEnableFDFJavaScript(true);
File input = new File("C:/MyDocument.pdf");
File output = new File("C:/MyOutputDirectory/");
PDFtoHTML5Converter converter = new PDFtoHTML5Converter(input, output, conversionOptions, viewerOptions);
try {
converter.convert();
} catch (PdfException e) {
e.printStackTrace();
}
}
You read our other article to understand the PDF format and if you’re looking for meanings of common PDF terms, we recommend you check out our PDF glossary.
FormVu allows you to
Use Interactive PDF Forms in the Web Browser |
Integrate fillable PDF Forms into Web Apps |
Parse PDF forms as HTML5 |