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.

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.
setLeftMargin(int 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.
setRightMargin(int 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.
setTopMargin(int 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.
getBottomMargin() Bottom page margin (for HTML rendering only)
setBottomMargin(Double bottomMargin) Sets the bottom page margin for HTML rendering.
setBottomMargin(int 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.

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.

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.

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.

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.

Parameters:

Parameter Type Description
leftMargin java.lang.Double The left page margin value to set.

setLeftMargin(int leftMargin)

public void setLeftMargin(int leftMargin)

Sets the left page margin for HTML rendering.

Parameters:

Parameter Type Description
leftMargin int The left page margin value to set.

getRightMargin()

public Double getRightMargin()

Gets the right page margin for HTML rendering.

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.

Parameters:

Parameter Type Description
rightMargin java.lang.Double The right page margin value to set.

setRightMargin(int rightMargin)

public void setRightMargin(int rightMargin)

Sets the right page margin for HTML rendering.

Parameters:

Parameter Type Description
rightMargin int The right page margin value to set.

getTopMargin()

public Double getTopMargin()

Retrieves the top page margin for HTML rendering.

Returns: java.lang.Double - the top page margin.

setTopMargin(Double topMargin)

public void setTopMargin(Double topMargin)

Sets the top page margin for HTML rendering.

Parameters:

Parameter Type Description
topMargin java.lang.Double The top page margin to set.

setTopMargin(int topMargin)

public void setTopMargin(int topMargin)

Sets the top page margin for HTML rendering.

Parameters:

Parameter Type Description
topMargin int 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.

getBottomMargin()

public Double getBottomMargin()

Bottom page margin (for HTML rendering only)

Returns: java.lang.Double - the bottom page margin.

setBottomMargin(Double bottomMargin)

public void setBottomMargin(Double bottomMargin)

Sets the bottom page margin for HTML rendering.

Parameters:

Parameter Type Description
bottomMargin java.lang.Double The bottom page margin to set.

setBottomMargin(int bottomMargin)

public void setBottomMargin(int bottomMargin)

Sets the bottom page margin for HTML rendering.

Parameters:

Parameter Type Description
bottomMargin int 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.