Class Configuration.JavaScriptSettings
- Enclosing class:
Configuration
A type containing settings related to JavaScript.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsetDebugIndentation
(Integer debugIndentation) Specifies the amount of spaces per indentation level when using JavaScript debugging.setDebugMode
(Configuration.JavaScriptDebugMode debugMode) Specifies the debug mode.setDisabled
(Boolean disabled) Specifies whether to not process JavaScript.setEnabled
(Boolean enabled) Deprecated.setIgnoreScriptElements
(Boolean ignoreScriptElements) Specifies whether to ignore <script> elements in the document, only executing user scripts.setJavaScriptEngine
(Configuration.JavaScriptEngine javaScriptEngine) Sets the JavaScript engine to be used.setMaxQueuedTasks
(Integer maxQueuedTasks) Specifies the maximum amount of tasks to be queued before ending JavaScript processing.setMaxScriptElements
(Integer maxScriptElements) Specifies the maximum amount of script elements in the document to process.setMaxTasksRepeated
(Integer maxTasksRepeated) Specifies the maximum number of times that the same task is allowed to be executed, before ending JavaScript processing.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.setMaxVirtualTimeOffset
(Integer maxVirtualTimeOffset) Specifies the maximum amount of virtual time in seconds to let pass before ending JavaScript processing.setNoLayout
(Boolean noLayout) Specifies whether to process JavaScript without causing document layouts or updates.setNoVirtualTime
(Boolean noVirtualTime) Specifies whether not to use virtual time for JavaScript.setStatementLimit
(Integer thousandsStatements) Specifies the maximum amount of JavaScript statements in thousands, which a single task may execute.setTimeLapse
(Boolean timeLapse) Specifies whether to fast-forward the virtual time of JavaScript every time it is retrieved.setTimeout
(Integer value) Sets a timeout in seconds for JavaScript processing If the timeout is exceeded, the conversion will be aborted.
-
Constructor Details
-
JavaScriptSettings
public JavaScriptSettings()
-
-
Method Details
-
setEnabled
Deprecated.Deprecated as of PDFreactor 12. Use
setDisabled(Boolean)
instead. -
setDisabled
Specifies whether to not process JavaScript.
-
setIgnoreScriptElements
Specifies whether to ignore <script> elements in the document, only executing user scripts.
-
setNoLayout
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
Specifies whether to fast-forward the virtual time of JavaScript every time it is retrieved.
Only use if required for a specific library.
-
setNoVirtualTime
Specifies whether not to use virtual time for JavaScript.
Only use if required for a specific library.
-
setMaxVirtualTimeOffset
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
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
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
Specifies the maximum amount of script elements in the document to process.
Values of 0 or less default to 1,000,000.
-
setStatementLimit
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
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
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.
-