ViewInfoOptions

Inheritance: java.lang.Object, com.groupdocs.viewer.options.BaseViewOptions

All Implemented Interfaces: com.groupdocs.viewer.options.IMaxSizeOptions

public class ViewInfoOptions extends BaseViewOptions implements IMaxSizeOptions

Provides options used for retrieving information about view.

The ViewInfoOptions class encapsulates additional settings and parameters that can be used to retrieve information about a view in the GroupDocs.Viewer component.

Example usage:


 ViewInfoOptions viewInfoOptions = ViewInfoOptions.forPngView(false);
 try (Viewer viewer = new Viewer("document.pdf")) {
     ViewInfo viewInfo = viewer.getViewInfo(viewInfoOptions);
     // Use the viewInfo object for further operations
 }
 

Note: The ViewInfoOptions class implements the IMaxSizeOptions interface to provide additional settings and size constraints for view information retrieval.

Methods

Method Description
isExtractText() Indicates whether text extraction is enabled.
setExtractText(boolean extractText) Sets the flag indicating whether text extraction is enabled.
getMaxWidth() Returns the maximum width of the output image for rendering to PNG/JPG.
setMaxWidth(int maxWidth) Sets the maximum width of the output image for rendering to PNG/JPG.
getMaxHeight() Returns the maximum height of the output image for rendering to PNG/JPG.
setMaxHeight(int maxHeight) Sets the maximum height of the output image for rendering to PNG/JPG.
getWidth() Returns the width of the image for rendering to PNG/JPG.
setWidth(int width) Sets the width of the image for rendering to PNG/JPG.
getHeight() Returns the height of the image for rendering to PNG/JPG.
setHeight(int height) Sets the height of the image for rendering to PNG/JPG.
forHtmlView() Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into HTML.
forHtmlView(boolean renderSinglePage) Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into HTML.
forJpgView() Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into JPG.
forJpgView(boolean extractText) Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into JPG.
forPngView() Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into PNG.
forPngView(boolean extractText) Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into PNG.
fromHtmlViewOptions(HtmlViewOptions options) Initializes a new instance of the ViewInfoOptions class based on the HtmlViewOptions object.
fromPngViewOptions(PngViewOptions options) Initializes a new instance of the ViewInfoOptions class based on the PngViewOptions object.
fromJpgViewOptions(JpgViewOptions options) Initializes a new instance of the ViewInfoOptions class based on the JpgViewOptions object.

isExtractText()

public boolean isExtractText()

Indicates whether text extraction is enabled.

Returns: boolean - True if text extraction is enabled, false otherwise.

setExtractText(boolean extractText)

public void setExtractText(boolean extractText)

Sets the flag indicating whether text extraction is enabled.

Parameters:

Parameter Type Description
extractText boolean True to enable text extraction, false to disable.

getMaxWidth()

public int getMaxWidth()

Returns the maximum width of the output image for rendering to PNG/JPG.

Returns: int - the maximum width of the output image.

setMaxWidth(int maxWidth)

public void setMaxWidth(int maxWidth)

Sets the maximum width of the output image for rendering to PNG/JPG.

Parameters:

Parameter Type Description
maxWidth int The maximum width of the output image.

getMaxHeight()

public int getMaxHeight()

Returns the maximum height of the output image for rendering to PNG/JPG.

Returns: int - the maximum height of the output image.

setMaxHeight(int maxHeight)

public void setMaxHeight(int maxHeight)

Sets the maximum height of the output image for rendering to PNG/JPG.

Parameters:

Parameter Type Description
maxHeight int The maximum height of the output image.

getWidth()

public int getWidth()

Returns the width of the image for rendering to PNG/JPG.

Returns: int - the width of the image.

setWidth(int width)

public void setWidth(int width)

Sets the width of the image for rendering to PNG/JPG.

Parameters:

Parameter Type Description
width int The width of the image.

getHeight()

public int getHeight()

Returns the height of the image for rendering to PNG/JPG.

Returns: int - the height of the image.

setHeight(int height)

public void setHeight(int height)

Sets the height of the image for rendering to PNG/JPG.

Parameters:

Parameter Type Description
height int The height of the image.

forHtmlView()

public static ViewInfoOptions forHtmlView()

Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into HTML.

Returns: ViewInfoOptions - New instance of the ViewInfoOptions class.

forHtmlView(boolean renderSinglePage)

public static ViewInfoOptions forHtmlView(boolean renderSinglePage)

Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into HTML.

Note: By default, HTML content will be rendered on multiple pages.

Parameters:

Parameter Type Description
renderSinglePage boolean Enables HTML content to be rendered on a single page.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

forJpgView()

public static ViewInfoOptions forJpgView()

Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into JPG.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

forJpgView(boolean extractText)

public static ViewInfoOptions forJpgView(boolean extractText)

Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into JPG.

Parameters:

Parameter Type Description
extractText boolean Enables text extraction.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

forPngView()

public static ViewInfoOptions forPngView()

Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into PNG.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

forPngView(boolean extractText)

public static ViewInfoOptions forPngView(boolean extractText)

Initializes a new instance of the ViewInfoOptions class to retrieve information about the view when rendering into PNG.

Parameters:

Parameter Type Description
extractText boolean Enables text extraction.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

fromHtmlViewOptions(HtmlViewOptions options)

public static ViewInfoOptions fromHtmlViewOptions(HtmlViewOptions options)

Initializes a new instance of the ViewInfoOptions class based on the HtmlViewOptions object.

Parameters:

Parameter Type Description
options HtmlViewOptions The HTML view options.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

fromPngViewOptions(PngViewOptions options)

public static ViewInfoOptions fromPngViewOptions(PngViewOptions options)

Initializes a new instance of the ViewInfoOptions class based on the PngViewOptions object.

Parameters:

Parameter Type Description
options PngViewOptions The PNG view options.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.

fromJpgViewOptions(JpgViewOptions options)

public static ViewInfoOptions fromJpgViewOptions(JpgViewOptions options)

Initializes a new instance of the ViewInfoOptions class based on the JpgViewOptions object.

Parameters:

Parameter Type Description
options JpgViewOptions The JPG view options.

Returns: ViewInfoOptions - New instance of ViewInfoOptions class.