Provides options for rendering documents into PDF format.
The PdfViewOptions class encapsulates additional settings and parameters that can be used to control the rendering of documents into PDF format in the GroupDocs.Viewer component. For details, see the documentation.
Example usage:
PdfViewOptions pdfViewOptions = new PdfViewOptions();
pdfViewOptions.setImageHeight(256);
pdfViewOptions.setImageWidth(128);
pdfViewOptions.setDefaultFontName("font-name");
try (Viewer viewer = new Viewer("document.pdf")) {
viewer.view(pdfViewOptions);
// Use the viewer object for further operations
}
The factory that implements methods for creating and releasing the output file stream.
PdfViewOptions()
public PdfViewOptions()
Initializes a new instance of the PdfViewOptions class with default settings.
This constructor creates a new PdfViewOptions object with “output.pdf” as the file path format for the output file. The output file will be placed into the current working directory of the application. For the code example, see the documentation.
PdfViewOptions(String outputFilePath)
public PdfViewOptions(String outputFilePath)
Initializes a new instance of the PdfViewOptions class.
This constructor creates a new PdfViewOptions object with the specified outputFilePath parameter representing the path for the output PDF file. For the code example, see the documentation.
Parameters:
Parameter
Type
Description
outputFilePath
java.lang.String
The path for the output PDF file.
PdfViewOptions(Path outputFilePath)
public PdfViewOptions(Path outputFilePath)
Initializes a new instance of the PdfViewOptions class.
public PdfOptimizationOptions getPdfOptimizationOptions()
Reduce output PDF file size applying optimization techniques with different options.
This option is supported for any input file formats which are supported for conversion to PDF: Supported document formats For details and code samples, see this page and its children.
public void setPdfOptimizationOptions(PdfOptimizationOptions pdfOptimizationOptions)
Reduce output PDF file size applying optimization techniques with different options.
This option is supported for any input file formats which are supported for conversion to PDF: Supported document formats For details and code samples, see this page and its children.
Retrieves the maximum width of an output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the maximum output image width (in pixels). GroupDocs.Viewer applies this property when rendering a single image to PDF. For details, see the documentation. If you set the property, this property is ignored.
Returns:
int - the maximum width of the output image in pixels.
setImageMaxWidth(int imageMaxWidth)
public void setImageMaxWidth(int imageMaxWidth)
Sets the maximum width of an output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the maximum output image width (in pixels). GroupDocs.Viewer applies this property when rendering a single image to PDF. For details, see the documentation. If you set the property, this property is ignored.
Parameters:
Parameter
Type
Description
imageMaxWidth
int
The maximum width of the output image in pixels.
getImageMaxHeight()
public int getImageMaxHeight()
Retrieves the maximum height of an output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the maximum output image height (in pixels). GroupDocs.Viewer applies this property when rendering a single image to PDF. For details, see the documentation. If you set the property, this property is ignored.
Returns:
int - the maximum height of the output image in pixels.
setImageMaxHeight(int imageMaxHeight)
public void setImageMaxHeight(int imageMaxHeight)
Sets the maximum height of an output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the maximum output image height (in pixels). GroupDocs.Viewer applies this property when rendering a single image to HTML only. For details, see the documentation. If you set the property, this property is ignored.
Parameters:
Parameter
Type
Description
imageMaxHeight
int
The maximum height of the output image in pixels.
getImageWidth()
public int getImageWidth()
Retrieves the width of the output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the output image width (in pixels). GroupDocs.Viewer applies this property when rendering a single image to PDF. For details, see the documentation. If you set this property, the property is ignored.
Returns:
int - the width of the output image in pixels.
setImageWidth(int imageWidth)
public void setImageWidth(int imageWidth)
Sets the width of the output image in pixels. This parameter applies only when converting a single image PDF.
Parameters:
Parameter
Type
Description
imageWidth
int
The width of the output image in pixels.
getImageHeight()
public int getImageHeight()
Retrieves the height of the output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the output image height (in pixels). GroupDocs.Viewer applies this property when rendering a single image to HTML only. For details, see the documentation. If you set this property, the property is ignored.
Returns:
int - the height of the output image in pixels.
setImageHeight(int imageHeight)
public void setImageHeight(int imageHeight)
Sets the height of the output image in pixels. This parameter applies only when converting a single image to HTML.
Use this property to set the output image height (in pixels). GroupDocs.Viewer applies this property when rendering a single image to HTML only. For details, see the documentation. If you set this property, the property is ignored.
Parameters:
Parameter
Type
Description
imageHeight
int
The height of the output image in pixels.
getSecurity()
public final Security getSecurity()
Retrieves the security options for the output PDF document.
public IDocumentSavingCallback getDocumentSavingCallback()
Retrieves the callback used to estimate the progress of saving a Words or Email document.
Returns:
com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback - the callback to estimate the document saving progress.