Provides options for rendering word processing documents.
The WordProcessingOptions class provides options for rendering word processing documents in the GroupDocs.Viewer component. It encapsulates settings and parameters that can be used to control the rendering process and output format for word processing files. For details, see the documentation.
Example usage:
PngViewOptions pngViewOptions = new PngViewOptions();
WordProcessingOptions wordProcessingOptions = pngViewOptions.getWordProcessingOptions();
wordProcessingOptions.setRenderTrackedChanges(true);
wordProcessingOptions.setLeftMargin(32f);
try (Viewer viewer = new Viewer("document.docx")) {
viewer.view(pngViewOptions);
// Use the viewer object for further operations
}
Gets a value determining if fields of certain types should be updated before saving the input WordProcessing document to the HTML, PDF, PNG, or JPEG output formats.
Sets a value determining if fields of certain types should be updated before saving the input WordProcessing document to the HTML, PDF, PNG, or JPEG output formats.
Initializes a new instance of the WordProcessingOptions class. Contains options for rendering word processing documents. For details, see the documentation.
getPageSize()
public PageSize getPageSize()
Retrieves the page size for rendering HTM and HTML files.
When using the default page size, some content may not fit into the page frame. To fit the contents, you can set a larger page size, such as A3, using PageSize.A3.
Note: The default value is PageSize.UNSPECIFIED, which means that a page size set in the page settings (Page Setup) will be used.
Sets the page size for rendering HTM and HTML files.
When using the default page size, some content may not fit into the page frame. To fit the contents, you can set a larger page size, such as A3, using PageSize.A3.
Note: The default value is PageSize.UNSPECIFIED, which means that a page size set in the page settings (Page Setup) will be used.
public void setEnableOpenTypeFeatures(boolean enableOpenTypeFeatures)
This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts.
Parameters:
Parameter
Type
Description
enableOpenTypeFeatures
boolean
True to enable OpenType features, false otherwise.
isUnlinkTableOfContents()
public boolean isUnlinkTableOfContents()
Indicates whether table of contents navigation should be disabled when rendering to HTML or PDF. When this option is set to true, for HTML rendering, relative links from the table of contents will be replaced with span tags, removing functionality but preserving visual appearance. For PDF rendering, the table of contents will be rendered as plain text without links.
Returns:
boolean - True if table of content navigation is disabled; otherwise, false.
public void setUnlinkTableOfContents(boolean unlinkTableOfContents)
Sets whether table of contents navigation should be disabled when rendering to HTML or PDF. When this option is set to true, for HTML rendering, relative links from the table of contents will be replaced with span tags, removing functionality but preserving visual appearance. For PDF rendering, the table of contents will be rendered as plain text without links.
Parameters:
Parameter
Type
Description
unlinkTableOfContents
boolean
Indicates whether table of content navigation should be disabled.
isUpdateFields()
public boolean isUpdateFields()
Gets a value determining if fields of certain types should be updated before saving the input WordProcessing document to the HTML, PDF, PNG, or JPEG output formats. Default value for this property is true \u2014 fields will be updated before saving.
Sets a value determining if fields of certain types should be updated before saving the input WordProcessing document to the HTML, PDF, PNG, or JPEG output formats. Default value for this property is true \u2014 fields will be updated before saving.
Returns:
boolean - true if the options are equal to the specified object, false otherwise.
hashCode()
public int hashCode()
Computes the hash code value for this object. The hash code is based on the internal state of the object and is used in hash-based data structures such as hash maps and hash sets.
Note: This method overrides the default implementation of the hashCode() method defined in the Object class.
Returns:
int - the hash code value for this object.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.