In this tutorial I will guide you on how you can convert fillable PDF forms to HTML forms 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. FormVu is the best tool for filling PDF forms in HTML.
- 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.setEnableAcroFormJS(true);
File input = new File("MyDocument.pdf");
File output = new File("MyOutputDirectory/");
PDFtoHTML5Converter converter = new PDFtoHTML5Converter(input, output, conversionOptions, viewerOptions);
try {
converter.convert();
} catch (PdfException e) {
e.printStackTrace();
}
Once converted, you’ll find the output HTML in the folder (specified by the `output` variable). Opening form.html will allow you to view the prior fillable PDF form in HTML form output! You’re then free to parse/edit/host the content as you see fit.
Read our other articles 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 |
What is FormVu?
FormVu is a commercial SDK for converting PDF Form files into standalone HTML with interactive form components.
Why use FormVu?
FormVu allows you to integrate PDF forms into your web application effortlessly while retaining all their interaction and functionality.
What licenses are available?
We have 3 licenses available:
Cloud for form conversion using the shared IDRsolutions cloud server, Self hosted server option for your own cloud or on-premise servers, and Enterprise for more demanding requirements.
How to use FormVu?
Want to learn more about FormVu and how to use it, we have plenty of tutorials and guides to help you.