Class ContentOptions

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

public class ContentOptions extends OutputModeOptions
The class to use for setting output options when using content mode.
  • Constructor Details

    • ContentOptions

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

      public ContentOptions()
    • ContentOptions

      public ContentOptions(String options)
  • Method Details

    • setCompleteDocument

      public ContentOptions setCompleteDocument(boolean value)
      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 behavior in SVG conversion.

      Possible value:

      • true/false

      Default: false

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

      Parameters:
      value - is of type boolean
      Returns:
      the ContentOptions Object
    • setFirstPageName

      @Deprecated(since="2016") public ContentOptions setFirstPageName(String value)
      Deprecated.
      We do not recommend that this option be used.
      Allows filename of the first page to be changed.

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

      Parameters:
      value - is of type String
      Returns:
      the ContentOptions Object
    • setOutputThumbnails

      public ContentOptions 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.
    • setContainerId

      public ContentOptions setContainerId(String value)
      Set the id to use for the page container div.

      Default: jpedal

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

      Parameters:
      value - is of type String
      Returns:
      the ContentOptions Object.
    • setGenerateSearchFile

      public ContentOptions 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.
    • setThumbnailMaxWidth

      public ContentOptions 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 ContentOptions 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.
    • setCssSuffix

      public ContentOptions setCssSuffix(String cssSuffix)
      Appends the provided cssSuffix value to any classes and IDs within the document.

      This allows you to prevent style conflicts when displaying multiple conversions within the same browsing context. For example, the selector for the first text style class on page 1 of a document would normally be `.s1_1`. However, setting a cssSuffix of `doc1` would change the selector to `.s1_1_doc1`.

      We recommend keeping the cssSuffix value short to prevent unnecessarily increasing the output filesize.

      Possible values:

      • Any string containing only characters [a-zA-Z0-9], hyphen (-) or underscore(_).

      Default: empty string

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

      Parameters:
      cssSuffix - the suffix to be added to all CSS names and identifiers
      Returns:
      the ConversionOptions Object.
      Since:
      2024.11