new OfficeToPDFOptions(JSON)
An object containing options for wordToPdf functions.
Parameters:
Name | Type | Description |
---|---|---|
JSON |
string | data containing options values for OfficeToPDFOptions. |
Members
-
<static> DisplayComments
-
Word document comment options
Type:
- number
Properties:
Name Type Description e_off
number Default value. Display no comments. e_annotations
number Display comments as annotations -
<static> StructureTagLevel
-
Level of detail for structure tags.
Type:
- number
Properties:
Name Type Description e_default
number Default level of structure tags, good for accessibility. e_none
number No structure tags. This can be used to get smaller file sizes.
Methods
-
getApplyPageBreaksToSheet()
-
Gets the value ApplyPageBreaksToSheet from the options object. Whether we should split Excel worksheets into pages so that the output resembles print output. If set to false (the default), Excel sheets will be placed one per page, except in the case where the sheets are very large
Returns:
The current value for ApplyPageBreaksToSheet.- Type
- boolean
-
getDisplayChangeTracking()
-
Gets the value DisplayChangeTracking from the options object. If this option is true, will display office change tracking markup present in the document (i.e, red strikethrough of deleted content and underlining of new content). Otherwise displays the resolved document content, with no markup. Defaults to true.
Returns:
The current value for DisplayChangeTracking.- Type
- boolean
-
getDisplayComments()
-
Gets the value DisplayComments from the options object. Specifies the display of comments that are present in the document. By default, comments will not be displayed.
Returns:
The current value for DisplayComments.- Type
- number
Example
Return value: <pre> PDFNet.Convert.OfficeToPDFOptions.DisplayComments = { e_off : 0 e_annotations : 1 } </pre>
-
getDisplayHiddenText()
-
Gets the value DisplayHiddenText from the options object. Display any hidden text that is present in the document (i.e., text that has been marked as 'Hidden' in the font style). By default, hidden text will not be displayed.
Returns:
The current value for DisplayHiddenText.- Type
- boolean
-
getExcelDefaultCellBorderWidth()
-
Gets the value ExcelDefaultCellBorderWidth from the options object. Cell border width for table cells that would normally be drawn with no border. In units of points. Can be used to achieve a similar effect to the "show gridlines" display option within Microsoft Excel.
Returns:
The current value for ExcelDefaultCellBorderWidth.- Type
- number
-
getExcelMaxAllowedCellCount()
-
Gets the value ExcelMaxAllowedCellCount from the options object. Conversion will throw an exception if the number of cells in a Microsoft Excel document is above the set MaxAllowedCellCount. Used for early termination of resource intensive conversions. Setting this value to 250000 will allow the vast majority of Excel documents to convert without issue, while keeping RAM usage to a reasonable level. By default there is no limit to the number of allowed cells.
Returns:
The current value for ExcelMaxAllowedCellCount.- Type
- number
-
getHideTotalNumberOfPages()
-
Gets the value HideTotalNumberOfPages from the options object. If the document has an element that displays the total number of pages and the total number of pages is unknown beforehand, remove those elements from the document.
Returns:
The current value for HideTotalNumberOfPages.- Type
- boolean
-
getIncludeBookmarks()
-
Gets the value IncludeBookmarks from the options object. When this option is set to false, Word document bookmarks will not be converted into PDF bookmarks. However, Word headings will still be automatically converted into PDF bookmarks. By default, both Word bookmarks and headings are converted into PDF bookmarks, providing a comprehensive navigation structure within the converted PDF.
Returns:
The current value for IncludeBookmarks.- Type
- boolean
-
getIncrementalSave()
-
Gets the value IncrementalSave from the options object. If this option is true, the document will be saved incrementally during the conversion, thus reducing the peak memory usage. Save an empty PDFDoc to the target location before the conversion so the incremental saving is done directly to the target location. Otherwise, a temporary file will be used. PDFDoc.Save still has to be called after the conversion is done to finalize the file. Doing PDFDoc.Save with e_incremental flag will reduce the saving time but increase the PDF file size.
Returns:
The current value for IncrementalSave.- Type
- boolean
-
getLayoutResourcesPluginPath()
-
Gets the value LayoutResourcesPluginPath from the options object. The path at which the pdftron-provided font resource plugin resides
Returns:
The current value for LayoutResourcesPluginPath.- Type
- string
-
getLocale()
-
Gets the value Locale from the options object. ISO 639-1 code of the locale to be applied during conversion. For example: 'en-US', 'ar-SA', 'de-DE', etc. Currently only applied during xls/xlsx conversions.
Returns:
The current value for Locale.- Type
- string
-
getPassword()
-
Gets the value Password from the options object. Password used to decrypt password-protected office documents.
Returns:
The current value for Password.- Type
- string
-
getResourceDocPath()
-
Gets the value ResourceDocPath from the options object. The path at which a .docx resource document resides
Returns:
The current value for ResourceDocPath.- Type
- string
-
getSmartSubstitutionPluginPath()
-
Gets the value SmartSubstitutionPluginPath from the options object. The path at which the pdftron-provided font resource plugin resides
Returns:
The current value for SmartSubstitutionPluginPath.- Type
- string
-
getStructureTagLevel()
-
Gets the value StructureTagLevel from the options object. Specifies the level of document structure tags to include in the PDF for accessibility purposes.
Returns:
The current value for StructureTagLevel.- Type
- number
Example
Return value: <pre> PDFNet.Convert.OfficeToPDFOptions.StructureTagLevel = { e_default : 0 e_none : 1 } </pre>
-
getTemplateLeftDelimiter()
-
Gets the value TemplateLeftDelimiter from the options object. Left delimiter for template tags. Defaults to '{{'.
Returns:
The current value for TemplateLeftDelimiter.- Type
- string
-
getTemplateParamsJson()
-
Gets the value TemplateParamsJson from the options object. JSON string representing the data to be merged into a PDFTron office template. For a more featureful template API, see CreateOfficeTemplate.
Returns:
The current value for TemplateParamsJson.- Type
- string
-
getTemplateRightDelimiter()
-
Gets the value TemplateRightDelimiter from the options object. Right delimiter for template tags. Defaults to '}}'.
Returns:
The current value for TemplateRightDelimiter.- Type
- string
-
getTemplateStrictMode()
-
Gets the value TemplateStrictMode from the options object. If "Strict Mode" is enabled, when a template key is missing from the json data an exception will be thrown. If "Strict Mode" is disabled (default), the tag will be replaced with no content.
Returns:
The current value for TemplateStrictMode.- Type
- boolean
-
getUpdateTableOfContents()
-
Gets the value UpdateTableOfContents from the options object. Updates the table of contents in the document so it matches the actual locations of headings/bookmarks. By default, the table of contents is not updated. Enabling this option may negatively affect conversion speed.
Returns:
The current value for UpdateTableOfContents.- Type
- boolean
-
setApplyPageBreaksToSheet(value)
-
Sets the value for ApplyPageBreaksToSheet in the options object. Whether we should split Excel worksheets into pages so that the output resembles print output. If set to false (the default), Excel sheets will be placed one per page, except in the case where the sheets are very large
Parameters:
Name Type Description value
boolean The new value for ApplyPageBreaksToSheet Returns:
This object, for call chaining. -
setDisplayChangeTracking(value)
-
Sets the value for DisplayChangeTracking in the options object. If this option is true, will display office change tracking markup present in the document (i.e, red strikethrough of deleted content and underlining of new content). Otherwise displays the resolved document content, with no markup. Defaults to true.
Parameters:
Name Type Description value
boolean The new value for DisplayChangeTracking Returns:
This object, for call chaining. -
setDisplayComments(value)
-
Sets the value for DisplayComments in the options object. Specifies the display of comments that are present in the document. By default, comments will not be displayed.
Parameters:
Name Type Description value
number The new value for DisplayComments PDFNet.Convert.OfficeToPDFOptions.DisplayComments = { e_off : 0 e_annotations : 1 }
Returns:
This object, for call chaining. -
setDisplayHiddenText(value)
-
Sets the value for DisplayHiddenText in the options object. Display any hidden text that is present in the document (i.e., text that has been marked as 'Hidden' in the font style). By default, hidden text will not be displayed.
Parameters:
Name Type Description value
boolean The new value for DisplayHiddenText Returns:
This object, for call chaining. -
setExcelDefaultCellBorderWidth(value)
-
Sets the value for ExcelDefaultCellBorderWidth in the options object. Cell border width for table cells that would normally be drawn with no border. In units of points. Can be used to achieve a similar effect to the "show gridlines" display option within Microsoft Excel.
Parameters:
Name Type Description value
number The new value for ExcelDefaultCellBorderWidth Returns:
This object, for call chaining. -
setExcelMaxAllowedCellCount(value)
-
Sets the value for ExcelMaxAllowedCellCount in the options object. Conversion will throw an exception if the number of cells in a Microsoft Excel document is above the set MaxAllowedCellCount. Used for early termination of resource intensive conversions. Setting this value to 250000 will allow the vast majority of Excel documents to convert without issue, while keeping RAM usage to a reasonable level. By default there is no limit to the number of allowed cells.
Parameters:
Name Type Description value
number The new value for ExcelMaxAllowedCellCount Returns:
This object, for call chaining. -
setHideTotalNumberOfPages(value)
-
Sets the value for HideTotalNumberOfPages in the options object. If the document has an element that displays the total number of pages and the total number of pages is unknown beforehand, remove those elements from the document.
Parameters:
Name Type Description value
boolean The new value for HideTotalNumberOfPages Returns:
This object, for call chaining. -
setIncludeBookmarks(value)
-
Sets the value for IncludeBookmarks in the options object. When this option is set to false, Word document bookmarks will not be converted into PDF bookmarks. However, Word headings will still be automatically converted into PDF bookmarks. By default, both Word bookmarks and headings are converted into PDF bookmarks, providing a comprehensive navigation structure within the converted PDF.
Parameters:
Name Type Description value
boolean The new value for IncludeBookmarks Returns:
This object, for call chaining. -
setIncrementalSave(value)
-
Sets the value for IncrementalSave in the options object. If this option is true, the document will be saved incrementally during the conversion, thus reducing the peak memory usage. Save an empty PDFDoc to the target location before the conversion so the incremental saving is done directly to the target location. Otherwise, a temporary file will be used. PDFDoc.Save still has to be called after the conversion is done to finalize the file. Doing PDFDoc.Save with e_incremental flag will reduce the saving time but increase the PDF file size.
Parameters:
Name Type Description value
boolean The new value for IncrementalSave Returns:
This object, for call chaining. -
setLayoutResourcesPluginPath(value)
-
Sets the value for LayoutResourcesPluginPath in the options object. The path at which the pdftron-provided font resource plugin resides
Parameters:
Name Type Description value
string The new value for LayoutResourcesPluginPath Returns:
This object, for call chaining. -
setLocale(value)
-
Sets the value for Locale in the options object. ISO 639-1 code of the locale to be applied during conversion. For example: 'en-US', 'ar-SA', 'de-DE', etc. Currently only applied during xls/xlsx conversions.
Parameters:
Name Type Description value
string The new value for Locale Returns:
This object, for call chaining. -
setPassword(value)
-
Sets the value for Password in the options object. Password used to decrypt password-protected office documents.
Parameters:
Name Type Description value
string The new value for Password Returns:
This object, for call chaining. -
setResourceDocPath(value)
-
Sets the value for ResourceDocPath in the options object. The path at which a .docx resource document resides
Parameters:
Name Type Description value
string The new value for ResourceDocPath Returns:
This object, for call chaining. -
setSmartSubstitutionPluginPath(value)
-
Sets the value for SmartSubstitutionPluginPath in the options object. The path at which the pdftron-provided font resource plugin resides
Parameters:
Name Type Description value
string The new value for SmartSubstitutionPluginPath Returns:
This object, for call chaining. -
setStructureTagLevel(value)
-
Sets the value for StructureTagLevel in the options object. Specifies the level of document structure tags to include in the PDF for accessibility purposes.
Parameters:
Name Type Description value
number The new value for StructureTagLevel PDFNet.Convert.OfficeToPDFOptions.StructureTagLevel = { e_default : 0 e_none : 1 }
Returns:
This object, for call chaining. -
setTemplateLeftDelimiter(value)
-
Sets the value for TemplateLeftDelimiter in the options object. Left delimiter for template tags. Defaults to '{{'.
Parameters:
Name Type Description value
string The new value for TemplateLeftDelimiter Returns:
This object, for call chaining. -
setTemplateParamsJson(value)
-
Sets the value for TemplateParamsJson in the options object. JSON string representing the data to be merged into a PDFTron office template. For a more featureful template API, see CreateOfficeTemplate.
Parameters:
Name Type Description value
string The new value for TemplateParamsJson Returns:
This object, for call chaining. -
setTemplateRightDelimiter(value)
-
Sets the value for TemplateRightDelimiter in the options object. Right delimiter for template tags. Defaults to '}}'.
Parameters:
Name Type Description value
string The new value for TemplateRightDelimiter Returns:
This object, for call chaining. -
setTemplateStrictMode(value)
-
Sets the value for TemplateStrictMode in the options object. If "Strict Mode" is enabled, when a template key is missing from the json data an exception will be thrown. If "Strict Mode" is disabled (default), the tag will be replaced with no content.
Parameters:
Name Type Description value
boolean The new value for TemplateStrictMode Returns:
This object, for call chaining. -
setUpdateTableOfContents(value)
-
Sets the value for UpdateTableOfContents in the options object. Updates the table of contents in the document so it matches the actual locations of headings/bookmarks. By default, the table of contents is not updated. Enabling this option may negatively affect conversion speed.
Parameters:
Name Type Description value
boolean The new value for UpdateTableOfContents Returns:
This object, for call chaining.