WordProcessingOptions
Inheritance: java.lang.Object
public class WordProcessingOptions
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
}
Constructors
Constructor | Description |
---|---|
WordProcessingOptions() | Initializes a new instance of the WordProcessingOptions class. |
Methods
Method | Description |
---|---|
getPageSize() | Retrieves the page size for rendering HTM and HTML files. |
setPageSize(PageSize pageSize) | Sets the page size for rendering HTM and HTML files. |
isRenderTrackedChanges() | Indicates whether tracked changes (revisions) rendering is enabled. |
setRenderTrackedChanges(boolean value) | Sets whether tracked changes (revisions) rendering is enabled. |
getLeftMargin() | Retrieves the left page margin for HTML rendering. |
setLeftMargin(Double leftMargin) | Sets the left page margin for HTML rendering. |
getRightMargin() | Gets the right page margin for HTML rendering. |
setRightMargin(Double rightMargin) | Sets the right page margin for HTML rendering. |
getTopMargin() | Retrieves the top page margin for HTML rendering. |
setTopMargin(Double topMargin) | Sets the top page margin for HTML rendering. |
isEnableOpenTypeFeatures() | This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts. |
setEnableOpenTypeFeatures(boolean enableOpenTypeFeatures) | This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts. |
isUnlinkTableOfContents() | Indicates whether table of contents navigation should be disabled when rendering to HTML or PDF. |
setUnlinkTableOfContents(boolean unlinkTableOfContents) | Sets whether table of contents navigation should be disabled when rendering to HTML or PDF. |
getBottomMargin() | Bottom page margin (for HTML rendering only) |
setBottomMargin(Double bottomMargin) | Sets the bottom page margin for HTML rendering. |
equals(Object o) | Check if the options are changed. |
hashCode() | {@inheritDoc} |
WordProcessingOptions()
public WordProcessingOptions()
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.
Returns: PageSize - The size of the output page.
setPageSize(PageSize pageSize)
public void setPageSize(PageSize pageSize)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
pageSize | PageSize | The size of the output page. |
isRenderTrackedChanges()
public final boolean isRenderTrackedChanges()
Indicates whether tracked changes (revisions) rendering is enabled.
For details, see the documentation.
Returns: boolean - true if tracked changes rendering is enabled, false otherwise.
setRenderTrackedChanges(boolean value)
public final void setRenderTrackedChanges(boolean value)
Sets whether tracked changes (revisions) rendering is enabled.
For details, see the documentation.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | true to enable tracked changes rendering, false to disable it. |
getLeftMargin()
public Double getLeftMargin()
Retrieves the left page margin for HTML rendering.
For details, see the documentation.
Returns: java.lang.Double - the left page margin value.
setLeftMargin(Double leftMargin)
public void setLeftMargin(Double leftMargin)
Sets the left page margin for HTML rendering.
For details, see the documentation.
Parameters:
Parameter | Type | Description |
---|---|---|
leftMargin | java.lang.Double | The left page margin value to set. |
getRightMargin()
public Double getRightMargin()
Gets the right page margin for HTML rendering.
For details, see the documentation.
Returns: java.lang.Double - the right page margin value.
setRightMargin(Double rightMargin)
public void setRightMargin(Double rightMargin)
Sets the right page margin for HTML rendering.
For details, see the documentation.
Parameters:
Parameter | Type | Description |
---|---|---|
rightMargin | java.lang.Double | The right page margin value to set. |
getTopMargin()
public Double getTopMargin()
Retrieves the top page margin for HTML rendering.
For details, see the documentation.
Returns: java.lang.Double - the top page margin.
setTopMargin(Double topMargin)
public void setTopMargin(Double topMargin)
Sets the top page margin for HTML rendering.
For details, see the documentation.
Parameters:
Parameter | Type | Description |
---|---|---|
topMargin | java.lang.Double | The top page margin to set. |
isEnableOpenTypeFeatures()
public boolean isEnableOpenTypeFeatures()
This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts.
Returns: boolean - True if OpenType features are enabled, false otherwise.
setEnableOpenTypeFeatures(boolean enableOpenTypeFeatures)
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.
setUnlinkTableOfContents(boolean unlinkTableOfContents)
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. |
getBottomMargin()
public Double getBottomMargin()
Bottom page margin (for HTML rendering only)
For details, see the documentation.
Returns: java.lang.Double - the bottom page margin.
setBottomMargin(Double bottomMargin)
public void setBottomMargin(Double bottomMargin)
Sets the bottom page margin for HTML rendering.
For details, see the documentation.
Parameters:
Parameter | Type | Description |
---|---|---|
bottomMargin | java.lang.Double | The bottom page margin to set. |
equals(Object o)
public boolean equals(Object o)
Check if the options are changed.
Parameters:
Parameter | Type | Description |
---|---|---|
o | java.lang.Object | The object to compare for equality. |
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.