Running from Java
A good way to run FormVu is directly from Java code, as IDEs will usually list available methods. This guide is aimed at developers with knowledge of Java. If you do not know Java, we recommend using the online converter.
Prerequisites:
- You must download formvu.jar
- Requires Java 17 or later (see version compatibility)
- Add formvu.jar to your project libraries
Quick Start:
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();
}
For more information, please see the Javadoc page for PDFtoHTML5Converter.
How are the settings controlled?
Available settings and their values can be found in the Javadoc. The key classes are:
- HTMLConversionOptions (General HTML Settings)
- FormViewerOptions (Settings available for the viewer)