Link

Options (JVM Flags)

FormVu offers various options to change the way forms are converted. If you are running FormVu via command line you can use the JVM flags listed below to configure the options. If you are running FormVu via Java code, you can interact with the API methods defined by the Javadoc. An example of command-line usage with JVM flags would be with the following command:

java -Dorg.jpedal.pdf2html.encryptTempFiles=true -Xmx512M -jar formvu.jar /inputDirectory/ /outputDirectory/

Available Settings

  1. addJavaScript
  2. clipOffsetAmount
  3. completeDocument
  4. compressImages
  5. compressSVG
  6. containerId
  7. convertPDFExternalFileToOutputType
  8. convertSpacesToNbsp
  9. decoupleEmptyValues
  10. decoupleFormData
  11. disableComments
  12. disableExternalHyperlinks
  13. disableHyperlinkDetection
  14. embedImagesAsBase64Stream
  15. enableAcroFormJS
  16. formFieldBackgroundHighlight
  17. formFieldBorderHighlight
  18. encryptTempFiles
  19. fontsToRasterizeInTextMode
  20. formTag
  21. generateSearchFile
  22. imageScale
  23. includedFonts
  24. inlineJavaScriptAndCSS
  25. inlineSVG
  26. keepGlyfsSeparate
  27. logicalPageRange
  28. maxPageHeight
  29. maxPageWidth
  30. noCheckboxOrRadioButtonImages
  31. omitNameDir
  32. outputContentMode
  33. outputThumbnails
  34. password
  35. pixelsPerInch
  36. realPageRange
  37. scaling
  38. separateTextToWords
  39. submitUrl
  40. tinyTextRemovalThreshold
  41. textMode
  42. useDRFormFonts
  43. useFormVuAPI
  44. useLegacyImageFileType

addJavaScript

Include all the JavaScript that is within the PDF file.

Flag:

 -Dorg.jpedal.pdf2html.addJavaScript=<value>

Expected values:

  • true
  • false

Javadoc: setAddJavaScript


clipOffsetAmount

Set the distance in pixels that polygons are expanded by in order to reduce fractional white lines that can appear in converted content. A value of 0 will disable this feature.

Flag:

 -Dorg.jpedal.pdf2html.clipOffsetAmount=<value>

Expected values:

  • Float value greater than or equal to 0, e.g. 0.3

completeDocument

Enabling this setting will output HTML, head and body tags.

This mode is recommended if content will be displayed within iframes.

This setting has no behaviour in SVG conversion.

Flag:

 -Dorg.jpedal.pdf2html.completeDocument=<value>

Expected values:

  • true
  • false

Javadoc: setCompleteDocument


compressImages

When enabled, generated PNG images will be compressed to reduce file size.

This setting has an effect only when SVG text modes are used, or when setUseLegacyImageFileType is set to true.

Rather than producing 24-bit RGB or 32-bit RGBA truecolor PNG images, instead the converter will produce 8-bit palette images that have undergone quantization and dithering. This is a lossy compression, but visual quality remains very high.

Enabling compression will make conversion slower. On average, expect conversion time to at least double. File size saving can be significant. On files with large images, it is not unusual to see savings of 70-80% on the image file size.

Flag:

 -Dorg.jpedal.pdf2html.compressImages=<value>

Expected values:

  • true
  • false

Javadoc: setCompressImages


compressSVG

Generates compressed .svgz files rather than .svg (you will need to configure your webserver to correctly serve these).

It is recommended to enable this setting as SVG file sizes can be reduced by as much as 80-90%!

SVGZ files are simply SVG files which have been gzip-compressed. Gzip compressed SVG files are supported by all modern browsers (IE9 onwards, Firefox, Chrome, etc) as long as the webserver is configured correctly.

For more information, please click here.

Flag:

 -Dorg.jpedal.pdf2html.compressSVG=<value>

Expected values:

  • true
  • false

Javadoc: setCompressSVG


containerId

Set the id to use for the page container div.

Flag:

 -Dorg.jpedal.pdf2html.containerId=<value>

Expected values:

  • A string

Javadoc: setContainerId


convertPDFExternalFileToOutputType

Set whether to convert links pointing to file.pdf into file.html inside GoToR and Launch link annotations.

Flag:

 -Dorg.jpedal.pdf2html.convertPDFExternalFileToOutputType=<value>

Expected values:

  • true
  • false

Javadoc: setConvertPDFExternalFileToOutputType


convertSpacesToNbsp

Convert spaces into Non-breaking Spaces (&nbsp;) in the output

Flag:

 -Dorg.jpedal.pdf2html.convertSpacesToNbsp=<value>

Expected values:

  • true
  • false

Javadoc: setConvertSpacesToNbsp


decoupleEmptyValues

Only active when decoupleFormData is true, this setting allows you to populate formdata.json with all fields present in the PDF, including entries that have empty values

Flag:

 -Dorg.jpedal.pdf2html.decoupleEmptyValues=<value>

Expected values:

  • true
  • false

Javadoc: setDecoupleEmptyValues


decoupleFormData

Update the conversion so that existing form field values that have been set in the PDF are not output in HTML fields. Instead, output these values into a JSON file (formdata.json). By default, this will only output the fields that do not have empty values. This behaviour can be changed with the decoupleEmptyValues setting. In order to have the desired effect, this setting will also not output the AP images of readonly text fields

Flag:

 -Dorg.jpedal.pdf2html.decoupleFormData=<value>

Expected values:

  • true
  • false

Javadoc: setDecoupleFormData


disableComments

Enable comments in the HTML output for clarity.

Sections within the generated output may be marked up with <!-- HTML comment tags --> to aid understanding of generated output and help parsing if necessary. Set this to false to enable those comments.

Note: The default value for this setting changed to true in the 2024.11 release, which explains why the name of this setting may now be considered misleading.

Flag:

 -Dorg.jpedal.pdf2html.disableComments=<value>

Expected values:

  • true
  • false

Javadoc: setDisableComments


Prevents outbound hyperlinks being included in the output.

This includes links defined within annotations as well as auto-detected hyperlinks within the PDF text.

Flag:

 -Dorg.jpedal.pdf2html.disableExternalHyperlinks=<value>

Expected Values

  • true
  • false

Default false

Since 2024.12


disableHyperlinkDetection

Disables the functionality that detects hyperlinks within PDF text.

In PDF, the only way to insert a hyperlink is using an annotation. However, most PDF readers will also try to detect hyperlinks within the text and make them clickable, too. In FormVu, such auto-detected hyperlinks are spoofed as annotations with the type TextLink.

This setting disables the link detection functionality, preventing the spoofed TextLink annotations. Links that are defined as annotations within the PDF file will still be included in the output. Please see the disableExternalHyperlinks setting to disable all hyperlinks.

Flag:

 -Dorg.jpedal.pdf2html.disableHyperlinkDetection=<value>

Expected Values

  • true
  • false

Default false

Since 2024.12


embedImagesAsBase64Stream

Embed images as Base64 stream.

Inserts the images directly into the file as a base64 stream instead of referencing an external file.

Flag:

 -Dorg.jpedal.pdf2html.embedImagesAsBase64Stream=<value>

Expected values:

  • true
  • false

Javadoc: setEmbedImagesAsBase64Stream


enableAcroFormJS

Enable JavaScript from the AcroForms to be included in the conversion output. JavaScript functionality must already be present in the PDF.

Flag:

 -Dorg.jpedal.pdf2html.enableAcroFormJS=<value>

Expected values:

  • true
  • false

Javadoc: setEnableAcroFormJS


formFieldBackgroundHighlight

Add a background of the specified colour to form fields. The specified colour must be in either long or short hexadecimal format.

This option currently adds a background to:

  • Text boxes
  • Select Boxes

This option does not add a background to:

  • Checkboxes
  • Radio Buttons
  • Buttons

When a malformed colour value is passed, background highlighting will be skipped and an error will be logged

Flag:

 -Dorg.jpedal.pdf2html.formFieldBackgroundHighlight=<value>

Expected values:

  • #F00 - Red background
  • #FFF0F5 - “Lavender Blush” background

Javadoc: setFormFieldBackgroundHighlight


formFieldBorderHighlight

Add a border of the specified colour to form fields. The specified colour must be in either long or short hexadecimal format.

This option currently adds a border to:

  • Text boxes
  • Select Boxes
  • Buttons

This option does not* add a border to:

  • Checkboxes
  • Radio Buttons

*Except in the case that no checkboxOrRadioButtonImages is enabled, where a border will be applied

When a malformed colour value is passed, background highlighting will be skipped and an error will be logged

Flag:

 -Dorg.jpedal.pdf2html.formFieldBorderHighlight=<value>

Expected values:

  • #F00 - Red border
  • #0000FF - Blue border

Javadoc: setFormFieldBorderHighlight


encryptTempFiles

Enables encryption of all temporary files that may be created during the conversion process.

Flag:

-Dorg.jpedal.pdf2html.encryptTempFiles=<value>

Expected values:

  • true
  • false

Javadoc: setEncryptTempFiles


fontsToRasterizeInTextMode

In Text Modes, you can override real text on a font by font basis,

In svg_realtext text will appear as part of SVG as Vectors This setting has no effect on other modes,

Needs to start EXCLUDE= or INCLUDE= followed by a list of comma-separated fonts Comparison is case-insensitive so Arial, ARIAL and arial are the same.

Flag:

 -Dorg.jpedal.pdf2html.fontsToRasterizeInTextMode=<value>

Expected values:

  • INCLUDE=font1,font2,font3

  • (rasterized JUST these fonts)

  • EXCLUDE=font1,font2,font3

  • (rasterized all fonts EXCEPT these fonts)

Javadoc: setFontsToRasterizeInTextMode


formTag

Replacing <form> with your version.

Flag:

 -Dorg.jpedal.pdf2html.formTag=<value>

Expected values:

  • <form **your code here**>

Javadoc: setFormTag


generateSearchFile

Generates a search.json file containing the text of the document you can process for different uses such as search.

Flag:

 -Dorg.jpedal.pdf2html.generateSearchFile=<value>

Expected values:

  • true
  • false

Javadoc: setGenerateSearchFile


imageScale

Write out larger images to allow higher quality zooming. Images are created to match the display size at 100% this value will scale those dimensions.

Flag:

 -Dorg.jpedal.pdf2html.imageScale=<value>

Expected Values

  • a float multiplier (e.g. 1.5)

Default 1


includedFonts

Set fonts to convert to and include in HTML and CSS output.

Will accept any comma-separated list of the expected values.

Flag:

 -Dorg.jpedal.pdf2html.includedFonts=<value>

Expected values:

  • woff
  • otf
  • cff
  • woff_base64
  • otf_base64

Javadoc: setIncludedFonts


inlineJavaScriptAndCSS

Inline JavaScript and CSS within HTML. This inlines the JavaScript into <\script> tags and CSS into <\style> within HTML so that there are no separate .js/.css files.

Flag:

 -Dorg.jpedal.pdf2html.inlineJavaScriptAndCSS=<value>

Expected values:

  • true
  • false

Javadoc: setInlineJavaScriptAndCSS


inlineSVG

Inline SVG within HTML (pure SVG text modes only).

This inlines the SVG within HTML so that there is no separate .svg file.

Flag:

 -Dorg.jpedal.pdf2html.inlineSVG=<value>

Expected values:

  • true
  • false

Javadoc: setInlineSVG


keepGlyfsSeparate

Position each glyph individually for more accurate positioning.

Produces a larger file but may suit some use cases

Flag:

 -Dorg.jpedal.pdf2html.keepGlyfsSeparate=<value>

Expected values:

  • true
  • false

Javadoc: setKeepGlyfsSeparate


logicalPageRange

Set a page range using logical page numbering.

For example, let’s assume a 7 page document with a page range of “2,4,6”.

When using this setting, you will get 1.html, 2.html and 3.html, and navigation bars would assume that only these 3 pages exist.

Flag:

 -Dorg.jpedal.pdf2html.logicalPageRange=<value>

Expected values:

  • Comma-separated values including ranges. E.g. “1,3,5-8,10”

Javadoc: setLogicalPageRange


maxPageHeight

Sets the maximum height of the converted document. This can be used in conjunction with maxPageWidth to limit page dimensions to a given size.

Pages larger than the given dimensions will be scaled down to fit within those dimensions. Pages smaller than the given dimensions will be unaffected.

This setting may be useful to prevent rogue documents with unusually large pages from causing OutOfMemoryErrors (which may otherwise bring down the JVM).

Flag:

 -Dorg.jpedal.pdf2html.maxPageHeight=<value>

Expected values:

  • Any positive integer value

maxPageWidth

Sets the maximum width of the converted document. This can be used in conjunction with maxPageHeight to limit page dimensions to a given size.

Pages larger than the given dimensions will be scaled down to fit within those dimensions. Pages smaller than the given dimensions will be unaffected.

This setting may be useful to prevent rogue documents with unusually large pages from causing OutOfMemoryErrors (which may otherwise bring down the JVM).

Flag:

 -Dorg.jpedal.pdf2html.maxPageWidth=<value>

Expected values:

  • Any positive integer value

noCheckboxOrRadioButtonImages

Form elements inside PDFs can contain an AP dictionary with instructions for how to display the various states:

  • hover
  • onclick
  • checked
  • unchecked

By default, these appearances are written as images.

This setting disables these images for checkboxes and radio buttons. Instead, the standard browser appearances for the <input> implementations are used.

Flag:

-Dorg.jpedal.pdf2html.noCheckboxOrRadioButtonImages=<value>

Expected values:

  • true
  • false

Javadoc: setNoCheckboxOrRadioButtonImages


omitNameDir

Controls the folder structure of the output.

By default, pages are output within a directory with the same name as the PDF file within the output directory specified.

Setting omitNameDir to true will cause pages to be output directly within the output directory specified.

Flag:

 -Dorg.jpedal.pdf2html.omitNameDir=<value>

Expected values:

  • true
  • false

Javadoc: setOmitNameDir


outputContentMode

The output content mode affects what content is included in the generated output. This can be used to reduce unwanted content.

Important: When using NO_FDFXFADUMP or REDUCED_CONTENT you will lose the functionality of submitting data and saving data back to a PDF for AcroForm PDFs. If you intend to use these features do not use these modes.

NO_MENU can be beneficial for users who do not want to use the provided menu for any converted form files.

Flag:

 -Dorg.jpedal.pdf2html.outputContentMode=<value>

Expected values:

  • DEFAULT - No changes to the output
  • NO_FDFXFADUMP - Disable the FDFXFA_DUMP div from the output
  • NO_MENU - Disable the FDFXFA_MENU div from the output
  • REDUCED_CONTENT - Disable both FDFXFA_DUMP, FDFXFA_MENU from the output

Javadoc: setOutputContentMode


outputThumbnails

Output thumbnails of pages in /thumbnails/

Flag:

-Dorg.jpedal.pdf2html.outputThumbnails=<value>

Expected values:

  • true
  • false

Javadoc: setOutputThumbnails


password

Set a password to be used when opening files

Flag:

 -Dorg.jpedal.pdf2html.password=<value>

Expected Values A String

Default null


pixelsPerInch

Set the internal resolution which determines the page size at 100% zoom/scaling.

The default size of a unit in the PDF coordinate system is 1/ 72 inch (72 units per inch). However, the majority of PDF readers display PDF files at either 96 or 110 PPI (pixels per inch). This means that at 100% zoom/scaling, most PDF Readers actually apply an internal scaling of ~1.33 (110/ 96) or ~1.528 (110/ 72).

FormVu uses the same technique by using a default resolution of 110 PPI, which is why the pixel values in the output produced are approximately 1.5x the units defined within the PDF file.

This configuration option can be used to modify the resolution, for example using a value of 72 would mean the pixel values align with the units defined within the PDF file.

Note: Other settings (such as scaling, maxPageWidth and maxPageHeight) also affect the size of the converted document.

Note: This setting should not be thought of as affecting pixel density. Instead, it determines the page size at default zoom/scaling.

Flag:

 -Dorg.jpedal.pdf2html.pixelsPerInch=<value>

Expected Values Any positive integer value, although in practice a value such as 72, 96 or 110 would be typical.

Default 110

Since 2024.08


realPageRange

Set a page range using real page numbering.

For example, let’s assume a 7 page document with a page range of “2,4,6”.

When using this setting, you will get 2.html, 4.html and 6.html, and navigation bars would behave as if pages 1, 3, 5 and 7 exist.

Flag:

 -Dorg.jpedal.pdf2html.realPageRange=<value>

Expected values:

  • Comma separated values including ranges. E.g. “1,3,5-8,10”

Javadoc: setRealPageRange


scaling

Sets the Scaling value of the converted content.

Flag:

 -Dorg.jpedal.pdf2html.scaling=<value>

Expected values:

  • 1 (float multiplier)
  • 1000x1000 (best fit width/height)
  • fitWidth1000 (best fit width)
  • fitHeight1000 (best fit height)

Javadoc: setScaling


separateTextToWords

Divide text chunks into words based on spaces This improves accuracy but not as much as keepGlyfsSeparate, It produces a larger file but may suit some use cases.

Flag:

 -Dorg.jpedal.pdf2html.separateTextToWords=<value>

Expected values:

  • true
  • false

Javadoc: setSeparateToWords


submitUrl

Set the default pdf form submission URL. Used for the “Submit Form” button in the converted output

Flag:

 -Dorg.jpedal.pdf2html.submitUrl=<value>

Expected values:

  • A string

Javadoc: setSubmitUrl


tinyTextRemovalThreshold

Removes text below the given font size in the generated output.

This prevents files containing a large amount of tiny text from creating bloated output which is slow to load and render in the web browser.

Note: This value is based on the PDF coordinate system, meaning it acts independently of the values used for the scaling and pixelsPerInch settings.

Flag:

 -Dorg.jpedal.pdf2html.tinyTextRemovalThreshold=<value>

Expected values:

  • Any positive float value, or 0 to disable this functionality.

Default 0.5

Since 2024.08


textMode

The text-mode controls how text is rendered in the HTML output, for example, your text can be made selectable or as an image and made non-selectable.

For an explanation of text modes, please click here.

Important: shapetext modes extract the font metrics from the embedded fonts and includes them as shapes. If there are no embedded fonts then the converter will use Arial to ensure that text is actually displayed, although this may not be an ideal match (and we recommend using embedded fonts).

In the case where there are no embedded fonts, it’s best to use a realtext mode.

Flag:

 -Dorg.jpedal.pdf2html.textMode=<value>

Expected values:

  • svg_realtext
  • svg_shapetext_selectable
  • svg_shapetext_nonselectable
  • image_realtext
  • image_shapetext_selectable
  • image_shapetext_nonselectable

Javadoc: setTextMode


useDRFormFonts

Be warned, this setting is experimental and is expected to be changed throughout versions

Allows control over whether embedded form fonts in DR object are used for display in text field

Flag:

 -Dorg.jpedal.pdf2html.useDRFormFonts=<value>

Expected values:

  • true
  • false

useFormVuAPI

Output the formvuapi.js file, which handles custom functionality such as submitting forms as JSON.

Flag:

 -Dorg.jpedal.pdf2html.useFormVuAPI=<value>

Expected values:

  • true
  • false

Javadoc: setUseFormVuAPI


useLegacyImageFileType

If enabled, all images output will use the PNG file type.

Flag:

 -Dorg.jpedal.pdf2html.useLegacyImageFileType=<value>

Expected values:

  • true
  • false

Javadoc: setUseLegacyImageFileType



What's included in your FormVu trial?

  • Access to download the SDK and run it locally.
  • Access to the cloud trial to convert documents in the IDR cloud.
  • Access to the Docker image to set up your own trial server in the cloud.
  • Communicate with IDR developers to ask questions & get expert advice.
  • Plenty of time to experiment and build a proof of concept.
  • Over 100 articles to help you get started and learn about FormVu.
  • An exceptional PDF Form to HTML converter that took over 20 years to build!

Start Your Free Trial