Class Configuration.JavaScriptSettings

java.lang.Object
com.realobjects.pdfreactor.Configuration.JavaScriptSettings
Enclosing class:
Configuration

public static final class Configuration.JavaScriptSettings extends Object

A type containing settings related to JavaScript.

  • Constructor Details

    • JavaScriptSettings

      public JavaScriptSettings()
  • Method Details

    • setEnabled

      Deprecated.

      Deprecated as of PDFreactor 12. Use setDisabled(Boolean) instead.

    • setDisabled

      public Configuration.JavaScriptSettings setDisabled(Boolean disabled)

      Specifies whether to not process JavaScript.

    • setIgnoreScriptElements

      public Configuration.JavaScriptSettings setIgnoreScriptElements(Boolean ignoreScriptElements)

      Specifies whether to ignore <script> elements in the document, only executing user scripts.

    • setNoLayout

      public Configuration.JavaScriptSettings setNoLayout(Boolean noLayout)

      Specifies whether to process JavaScript without causing document layouts or updates.

      This can speed up conversions, but will break a significant amount of functionality and libraries.

    • setTimeLapse

      public Configuration.JavaScriptSettings setTimeLapse(Boolean timeLapse)

      Specifies whether to fast-forward the virtual time of JavaScript every time it is retrieved.

      Only use if required for a specific library.

    • setNoVirtualTime

      public Configuration.JavaScriptSettings setNoVirtualTime(Boolean noVirtualTime)

      Specifies whether not to use virtual time for JavaScript.

      Only use if required for a specific library.

    • setMaxVirtualTimeOffset

      public Configuration.JavaScriptSettings setMaxVirtualTimeOffset(Integer maxVirtualTimeOffset)

      Specifies the maximum amount of virtual time in seconds to let pass before ending JavaScript processing.

      Values of 0 or less default to 3,600 (1h).

    • setMaxQueuedTasks

      public Configuration.JavaScriptSettings setMaxQueuedTasks(Integer maxQueuedTasks)

      Specifies the maximum amount of tasks to be queued before ending JavaScript processing.

      Values of 0 or less default to 1,000,000.

    • setMaxTasksWithoutDomChange

      public Configuration.JavaScriptSettings setMaxTasksWithoutDomChange(Integer maxTasksWithoutDomChange)

      Specifies the maximum amount of tasks to be allowed to be queued, while the DOM does not change, before ending JavaScript processing.

      Values of 0 or less default to 1,000.

    • setMaxTasksRepeated

      public Configuration.JavaScriptSettings setMaxTasksRepeated(Integer maxTasksRepeated)

      Specifies the maximum number of times that the same task is allowed to be executed, before ending JavaScript processing.

      Values of 0 or less default to 1,000.

      Note: This setting does not apply to the GraalJS JavaScipt engine.

    • setMaxScriptElements

      public Configuration.JavaScriptSettings setMaxScriptElements(Integer maxScriptElements)

      Specifies the maximum amount of script elements in the document to process.

      Values of 0 or less default to 1,000,000.

    • setStatementLimit

      public Configuration.JavaScriptSettings setStatementLimit(Integer thousandsStatements)

      Specifies the maximum amount of JavaScript statements in thousands, which a single task may execute. This limit allows to break out of infinite loops, but setting it too low may abort the conversion process unnecessarily.

      When the limit of statements is exceeded, the conversion is aborted with a TimeoutException.

      A value of 0 defaults to 1,000,000 (which equates to 1 billion statements per task).

      Values smaller than 0 disable the limit.

      Note: This setting does not apply to the GraalJS JavaScipt engine.

    • setDebugIndentation

      public Configuration.JavaScriptSettings setDebugIndentation(Integer debugIndentation)

      Specifies the amount of spaces per indentation level when using JavaScript debugging.

      The default value is 0.

      Note: This setting does not apply to the GraalJS JavaScipt engine.

    • setDebugMode

      Specifies the debug mode.

      Any other value than the default Configuration.JavaScriptDebugMode.NONE impacts performance significantly and should not be used in production.

      Note: This setting does not apply to the GraalJS JavaScipt engine.

    • setTimeout

      public Configuration.JavaScriptSettings setTimeout(Integer value)

      Sets a timeout in seconds for JavaScript processing If the timeout is exceeded, the conversion will be aborted.

      A timeout of 0 or negative values mean that the conversion will never time out. This is also the default behavior if no timeout is specified.

    • setJavaScriptEngine

      public Configuration.JavaScriptSettings setJavaScriptEngine(Configuration.JavaScriptEngine javaScriptEngine)

      Sets the JavaScript engine to be used.