public class WordProcessingOptions extends Object
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
}
Viewer,
PngViewOptions| Constructor and Description |
|---|
WordProcessingOptions()
Initializes a new instance of the
WordProcessingOptions class. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Check if the options are changed.
|
Double |
getBottomMargin()
Bottom page margin (for HTML rendering only)
|
int |
getHorizontalResolution()
Gets the horizontal resolution for generated images in dots per inch.
|
Double |
getLeftMargin()
Retrieves the left page margin for HTML rendering.
|
WordsPageNumberLocation |
getPageNumberLocation()
Allows to forcibly apply page numbering for the loaded WordProcessing document.
|
PageSize |
getPageSize()
Retrieves the page size for rendering HTM and HTML files.
|
Double |
getRightMargin()
Gets the right page margin for HTML rendering.
|
Double |
getTopMargin()
Retrieves the top page margin for HTML rendering.
|
int |
getVerticalResolution()
Gets the vertical resolution for generated images in dots per inch.
|
int |
hashCode() |
boolean |
isEnableOpenTypeFeatures()
This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts.
|
boolean |
isRenderTrackedChanges()
Indicates whether tracked changes (revisions) rendering is enabled.
|
boolean |
isUnlinkTableOfContents()
Indicates whether table of contents navigation should be disabled when rendering to HTML or PDF.
|
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.
|
void |
setBottomMargin(Double bottomMargin)
Sets the bottom page margin for HTML rendering.
|
void |
setEnableOpenTypeFeatures(boolean enableOpenTypeFeatures)
This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts.
|
void |
setHorizontalResolution(int horizontalResolution)
Sets the horizontal resolution for generated images in dots per inch.
|
void |
setLeftMargin(Double leftMargin)
Sets the left page margin for HTML rendering.
|
void |
setPageNumberLocation(WordsPageNumberLocation pageNumberLocation)
Allows to forcibly apply page numbering for the loaded WordProcessing document.
|
void |
setPageSize(PageSize pageSize)
Sets the page size for rendering HTM and HTML files.
|
void |
setRenderTrackedChanges(boolean value)
Sets whether tracked changes (revisions) rendering is enabled.
|
void |
setRightMargin(Double rightMargin)
Sets the right page margin for HTML rendering.
|
void |
setTopMargin(Double topMargin)
Sets the top page margin for HTML rendering.
|
void |
setUnlinkTableOfContents(boolean unlinkTableOfContents)
Sets whether table of contents navigation should be disabled when rendering to HTML or PDF.
|
void |
setUpdateFields(boolean updateFields)
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.
|
void |
setVerticalResolution(int verticalResolution)
Sets the vertical resolution for generated images in dots per inch.
|
public WordProcessingOptions()
Initializes a new instance of the WordProcessingOptions class.
Contains options for rendering word processing documents. For details, see the documentation.
public boolean equals(Object o)
Check if the options are changed.
public Double getBottomMargin()
Bottom page margin (for HTML rendering only)
For details, see the documentation.public int getHorizontalResolution()
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
public Double getLeftMargin()
Retrieves the left page margin for HTML rendering.
For details, see the documentation.public WordsPageNumberLocation getPageNumberLocation()
WordsPageNumberLocation.NOT_APPLY — document is intact.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.
public Double getRightMargin()
Gets the right page margin for HTML rendering.
For details, see the documentation.public Double getTopMargin()
Retrieves the top page margin for HTML rendering.
For details, see the documentation.public int getVerticalResolution()
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
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.
public boolean isEnableOpenTypeFeatures()
This option enables kerning and other OpenType Features when rendering Arabic, Hebrew, Indian scripts, Latin-based or Cyrillic-based scripts.
public final boolean isRenderTrackedChanges()
Indicates whether tracked changes (revisions) rendering is enabled.
For details, see the documentation.true if tracked changes rendering is enabled, false otherwise.public boolean isUnlinkTableOfContents()
public boolean isUpdateFields()
For details, see the documentation.
public void setBottomMargin(Double bottomMargin)
Sets the bottom page margin for HTML rendering.
For details, see the documentation.bottomMargin - The bottom page margin to set.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.
enableOpenTypeFeatures - True to enable OpenType features, false otherwise.public void setHorizontalResolution(int horizontalResolution)
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
horizontalResolution - the horizontal resolution in DPI.public void setLeftMargin(Double leftMargin)
Sets the left page margin for HTML rendering.
For details, see the documentation.leftMargin - The left page margin value to set.public void setPageNumberLocation(WordsPageNumberLocation pageNumberLocation)
WordsPageNumberLocation.NOT_APPLY — document is intact.pageNumberLocation - the page number location.IllegalArgumentException - if pageNumberLocation is null.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.
pageSize - The size of the output page.public final void setRenderTrackedChanges(boolean value)
Sets whether tracked changes (revisions) rendering is enabled.
For details, see the documentation.value - true to enable tracked changes rendering, false to disable it.public void setRightMargin(Double rightMargin)
Sets the right page margin for HTML rendering.
For details, see the documentation.rightMargin - The right page margin value to set.public void setTopMargin(Double topMargin)
Sets the top page margin for HTML rendering.
For details, see the documentation.topMargin - The top page margin to set.public void setUnlinkTableOfContents(boolean unlinkTableOfContents)
unlinkTableOfContents - Indicates whether table of content navigation should be disabled.public void setUpdateFields(boolean updateFields)
For details, see the documentation.
public void setVerticalResolution(int verticalResolution)
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
verticalResolution - the vertical resolution in DPI.Copyright © 2026 Aspose Pty Ltd. All rights reserved.