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.
Initializes a new instance of the ViewInfoOptions class based on a PdfViewOptions object.
isExtractText()
public boolean isExtractText()
Indicates whether text extraction is enabled.
Use this property to get the text contained in a source document and its coordinates. Then you can use this data to add a selectable text over the image or to implement a text search in image-based rendering. For code example, see the documentation.
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.
Use this property to get the text contained in a source document and its coordinates. Then you can use this data to add a selectable text over the image or to implement a text search in image-based rendering. For code example, see the documentation.
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.
Use this property to set the maximum output image width (in pixels). For code example, see the documentation. If you set the property, this property is ignored.
Returns:
int - the maximum width of the output image.
setMaxWidth(int maxWidth)
public void setMaxWidth(int maxWidth)
Sets the maximum width of an output image (in pixels, for rendering to PNG/JPG only).
Use this property to set the maximum output image width (in pixels). For code example, see the documentation. If you set the property, this property is ignored.
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.
Use this property to set the maximum output image height (in pixels). For code example, see the documentation. If you set the property, this property is ignored.
Returns:
int - the maximum height of the output image.
setMaxHeight(int maxHeight)
public void setMaxHeight(int maxHeight)
Sets the maximum height of an output image (in pixels, for rendering to PNG/JPG only).
Use this property to set the maximum output image height (in pixels). For code example, see the documentation. If you set the property, this property is ignored.
Parameters:
Parameter
Type
Description
maxHeight
int
The maximum height of the output image.
getWidth()
public int getWidth()
The width of the output image (in pixels, for rendering to PNG/JPG only).
Use this property to set the output image width (in pixels). For code example, see the documentation. If you set this property, the property is ignored.
Returns:
int - the width of the image.
setWidth(int width)
public void setWidth(int width)
The width of the output image (in pixels, for rendering to PNG/JPG only).
Use this property to set the output image width (in pixels). For code example, see the documentation. If you set this property, the property is ignored.
Parameters:
Parameter
Type
Description
width
int
The width of the image.
getHeight()
public int getHeight()
The height of the output image (in pixels, for rendering to PNG/JPG only).
Use this property to set the output image height (in pixels). For code example, see the documentation. If you set this property, the property is ignored.
Returns:
int - the height of the image.
setHeight(int height)
public void setHeight(int height)
The height of the output image (in pixels, for rendering to PNG/JPG only).
Use this property to set the output image height (in pixels). For code example, see the documentation. If you set this property, the property is ignored.
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.
forPdfView()
public static ViewInfoOptions forPdfView()
Initializes a new instance of the ViewInfoOptions class to retrieve information about view when rendering into PDF.