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. completeDocument
  3. compressImages
  4. compressSVG
  5. containerId
  6. convertPDFExternalFileToOutputType
  7. convertSpacesToNbsp
  8. disableComments
  9. disableLinkGeneration
  10. embedImagesAsBase64Stream
  11. enableFDFJavaScript
  12. encryptTempFiles
  13. fontsToRasterizeInTextMode
  14. formTag
  15. generateSearchFile
  16. imageScale
  17. includedFonts
  18. inlineJavaScriptAndCSS
  19. inlineSVG
  20. keepGlyfsSeparate
  21. logicalPageRange
  22. noCheckboxOrRadioButtonImages
  23. omitNameDir
  24. outputContentMode
  25. outputThumbnails
  26. password
  27. realPageRange
  28. scaling
  29. separateTextToWords
  30. submitUrl
  31. textMode
  32. useFormVuAPI
  33. useLegacyImageFileType

addJavaScript

Include all the JavaScript that is within the PDF file.

Flag:

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

Expected values:

  • true
  • false

Javadoc: setAddJavaScript


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


disableComments

Disable comments inserted into the HTML output for clarity.

Sections within the generated output are marked up with <!-- HTML comment tags --> to aid understanding of generated output and help parsing if necessary. Enabling this setting will remove those comments.

Flag:

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

Expected values:

  • true
  • false

Javadoc: setDisableComments


disableLinkGeneration

Allow URLs found in the text content to be created as clickable links instead of plain text.

Flag:

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

Expected Values

  • true
  • false

Default true


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


enableFDFJavaScript

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

Flag:

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

Expected values:

  • true
  • false

Javadoc: enableFDFJavaScript


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


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


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


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


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


Still need help? Send us your questions.