Class FormViewerOptions

java.lang.Object
org.jpedal.render.output.OutputModeOptions
org.jpedal.render.output.FormViewerOptions

public class FormViewerOptions extends OutputModeOptions
The class to use for setting output options when using FormVu.
  • Constructor Details

    • FormViewerOptions

      public FormViewerOptions(Map<String,String> jvmOptions)
    • FormViewerOptions

      public FormViewerOptions()
  • Method Details

    • setSubmitUrl

      public FormViewerOptions setSubmitUrl(String value)
      Set the default pdf form submission URL

      Please Note: once the user click submit button the filled pdf form will be posted to server as base64 String with the parameter name "pdfdata"

      Possible values:

      • https://form.submission.com/

      Default: none

      Also set with -Dorg.jpedal.pdf2html.submitUrl=

      Parameters:
      value - is of type String.
      Returns:
      the FormViewerOptions Object.
    • setInlineJavaScriptAndCSS

      public FormViewerOptions setInlineJavaScriptAndCSS(boolean value)
      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.

      Possible values:

      • true/false

      Default: false

      Also set with -Dorg.jpedal.pdf2html.inlineJavaScriptAndCSS=

      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
    • setEnableFDFJavaScript

      @Deprecated public FormViewerOptions setEnableFDFJavaScript(boolean value)
      Deprecated.
      Replaced with setEnableAcroFormJS(final boolean value)
      Function has been renamed to setEnableAcroFormJS
      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
    • setEnableAcroFormJS

      public FormViewerOptions setEnableAcroFormJS(boolean value)
      Enable JavaScript from the AcroForm PDF to be included in the conversion output.

      JavaScript functionality must already be present in the PDF.

      Possible values:

      • true/false

      Default: false

      Also set with -Dorg.jpedal.pdf2html.enableAcroFormJS=

      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
    • setNoCheckboxOrRadioButtonImages

      public FormViewerOptions setNoCheckboxOrRadioButtonImages(boolean value)
      Do not use the on/off images from the converted PDF for checkboxes/radio buttons.

      Uses the HTML <input> implementations instead.

      Possible values:

      • true/false

      Default: false

      Also set with -Dorg.jpedal.pdf2html.noCheckboxOrRadioButtonImages=

      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
    • setOutputContentMode

      public FormViewerOptions setOutputContentMode(FormViewerOptions.OutputContentMode 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.

      Possible 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

      Also set in the JVM options with -Dorg.jpedal.pdf2html.outputContentMode=

      Parameters:
      outputContentMode - - The content mode for the desired output.
      Returns:
      the FormViewerOptions Object.
    • setUseFormVuAPI

      public FormViewerOptions setUseFormVuAPI(boolean value)
      Output the formvuapi.js file, which handles custom functionality such as submitting forms as JSON.

      Possible values:

      • true/false

      Default: true

      Also set with -Dorg.jpedal.pdf2html.useFormVuAPI=

      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
    • setFormFieldBorderHighlight

      public FormViewerOptions setFormFieldBorderHighlight(String value)
      Set a color represented by hex format to be used to outline to highlight form fields.

      When This value isn't set, outline highlights will not be added.

      Example values:

      • #FF0000, #F6a4bb, a0000b

      Default: unset

      Also set with -Dorg.jpedal.pdf2html.formFieldBorderHighlight=

      Parameters:
      value - String Hex Colour.
      Returns:
      the FormViewerOptions Object.
    • setFormFieldBackgroundHighlight

      public FormViewerOptions setFormFieldBackgroundHighlight(String value)
      Set a color represented by hex format to be used as a background to highlight form fields.

      When This value isn't set, background highlights will not be added.

      Example values:

      • #FF0000, #F6a4bb, a0000b

      Default: unset

      Also set with -Dorg.jpedal.pdf2html.formFieldBackgroundHighlight=

      Parameters:
      value - String Hex Colour.
      Returns:
      the FormViewerOptions Object.
    • getInlineJavaScriptAndCSS

      public boolean getInlineJavaScriptAndCSS()
    • setGenerateSearchFile

      public FormViewerOptions setGenerateSearchFile(boolean value)
      Generates search.json. This file contains an array (one element per page) containing the textual content from each page. It is used by idrviewer.search.js for page search.

      search.json is always generated in the IDRViewer Complete UI. Search is not supported as standard in other IDRViewer UI modes.

      Possible value:

      • true/false

      Also set with -Dorg.jpedal.pdf2html.generateSearchFile=

      Overrides:
      setGenerateSearchFile in class OutputModeOptions
      Parameters:
      value - is of type boolean.
      Returns:
      the OutputModeOptions object.
    • setOutputThumbnails

      public FormViewerOptions setOutputThumbnails(boolean value)
      Output thumbnails of pages in /thumbnails/.

      Possible value:

      • true/false

      Default: false

      Thumbnails are always generated if using the IDRViewer with ViewerUI Complete.

      Also set with -Dorg.jpedal.pdf2html.outputThumbnails=

      Overrides:
      setOutputThumbnails in class OutputModeOptions
      Parameters:
      value - is of type boolean.
      Returns:
      the OutputModeOptions Object.
    • setThumbnailMaxWidth

      public FormViewerOptions setThumbnailMaxWidth(int value)
      Sets the maximum width of the thumbnails. Can be used in conjunction with setThumbnailMaxHeight.

      If both a width and height are given then the generated thumbnails will fit within the bounds given, maintaining the aspect ratio of the original page.

      If only a width or height is given then the size of the generated thumbnails will match the bound given, again maintaining the aspect ratio of the original page.

      Possible values:

      • Any positive integer
      Also set with -Dorg.jpedal.pdf2html.thumbnailMaxWidth=
      Overrides:
      setThumbnailMaxWidth in class OutputModeOptions
      Parameters:
      value - the maximum thumbnail width
      Returns:
      the OutputModeOptions object.
    • setThumbnailMaxHeight

      public FormViewerOptions setThumbnailMaxHeight(int value)
      Sets the maximum height of the thumbnails. Can be used in conjunction with setThumbnailMaxWidth.

      If both a width and height are given then the generated thumbnails will fit within the bounds given, maintaining the aspect ratio of the original page.

      If only a width or height is given then the size of the generated thumbnails will match the bound given, again maintaining the aspect ratio of the original page.

      Possible values:

      • Any positive integer
      Also set with -Dorg.jpedal.pdf2html.thumbnailMaxHeight=
      Overrides:
      setThumbnailMaxHeight in class OutputModeOptions
      Parameters:
      value - the maximum thumbnail height
      Returns:
      the OutputModeOptions object.
    • setDecoupleFormData

      public FormViewerOptions setDecoupleFormData(boolean value)
      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/default 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

      Possible values:

      • true/false

      Default: false

      Also set with -Dorg.jpedal.pdf2html.decoupleFormData=

      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
      See Also:
    • setDecoupleEmptyValues

      public FormViewerOptions setDecoupleEmptyValues(boolean value)
      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 default/empty values

      Possible values:

      • true/false

      Default: false

      Also set with -Dorg.jpedal.pdf2html.decoupleEmptyValues=

      Parameters:
      value - Boolean true/false.
      Returns:
      the FormViewerOptions Object.
      See Also: