PdfViewOptions

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

public class PdfViewOptions extends ViewOptions

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
 }
 

Constructors

Constructor Description
PdfViewOptions(CreateFileStream createFileStream) Initializes a new instance of the PdfViewOptions class.
PdfViewOptions(CreateFileStream createFileStream, ReleaseFileStream releaseFileStream) Initializes a new instance of the PdfViewOptions class.
PdfViewOptions(FileStreamFactory fileStreamFactory) Initializes a new instance of the PdfViewOptions class.
PdfViewOptions() Initializes a new instance of the PdfViewOptions class with default settings.
PdfViewOptions(String outputFilePath) Initializes a new instance of the PdfViewOptions class.
PdfViewOptions(Path outputFilePath) Initializes a new instance of the PdfViewOptions class.

Methods

Method Description
getPdfOptimizationOptions() Reduce output PDF file size applying optimization techniques with different options.
setPdfOptimizationOptions(PdfOptimizationOptions pdfOptimizationOptions) Reduce output PDF file size applying optimization techniques with different options.
getImageMaxWidth() Retrieves the maximum width of an output image in pixels.
setImageMaxWidth(int imageMaxWidth) Sets the maximum width of an output image in pixels.
getImageMaxHeight() Retrieves the maximum height of an output image in pixels.
setImageMaxHeight(int imageMaxHeight) Sets the maximum height of an output image in pixels.
getImageWidth() Retrieves the width of the output image in pixels.
setImageWidth(int imageWidth) Sets the width of the output image in pixels.
getImageHeight() Retrieves the height of the output image in pixels.
setImageHeight(int imageHeight) Sets the height of the output image in pixels.
getSecurity() Retrieves the security options for the output PDF document.
setSecurity(Security value) Sets the security options for the output PDF document.
getDocumentSavingCallback() Retrieves the callback used to estimate the progress of saving a Words or Email document.
setDocumentSavingCallback(IDocumentSavingCallback documentSavingCallback) Sets the callback used to estimate the progress of saving a Words or Email document.

PdfViewOptions(CreateFileStream createFileStream)

public PdfViewOptions(CreateFileStream createFileStream)

Initializes a new instance of the PdfViewOptions class.

For the code example, see the documentation.

Parameters:

Parameter Type Description
createFileStream CreateFileStream

PdfViewOptions(CreateFileStream createFileStream, ReleaseFileStream releaseFileStream)

public PdfViewOptions(CreateFileStream createFileStream, ReleaseFileStream releaseFileStream)

Initializes a new instance of the PdfViewOptions class.

For the code example, see the documentation.

Parameters:

Parameter Type Description
createFileStream CreateFileStream The method used to instantiate the stream for writing the output file data.
releaseFileStream ReleaseFileStream The method used to release the stream created by the createFileStream method.

PdfViewOptions(FileStreamFactory fileStreamFactory)

public PdfViewOptions(FileStreamFactory fileStreamFactory)

Initializes a new instance of the PdfViewOptions class.

For the code example, see the documentation.

Parameters:

Parameter Type Description
fileStreamFactory FileStreamFactory 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.

For the code example, see the documentation.

Parameters:

Parameter Type Description
outputFilePath java.nio.file.Path The path for the output PDF file.

getPdfOptimizationOptions()

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.

Returns: PdfOptimizationOptions - PdfOptimizationOptions object or null.

setPdfOptimizationOptions(PdfOptimizationOptions pdfOptimizationOptions)

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.

Parameters:

Parameter Type Description
pdfOptimizationOptions PdfOptimizationOptions PdfOptimizationOptions object or null.

getImageMaxWidth()

public int getImageMaxWidth()

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.

For details, see the documentation.

Returns: Security - the security options for the output PDF document.

setSecurity(Security value)

public final void setSecurity(Security value)

Sets the security options for the output PDF document.

For details, see the documentation.

Parameters:

Parameter Type Description
value Security The security options for the output PDF document.

getDocumentSavingCallback()

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.

setDocumentSavingCallback(IDocumentSavingCallback documentSavingCallback)

public void setDocumentSavingCallback(IDocumentSavingCallback documentSavingCallback)

Sets the callback used to estimate the progress of saving a Words or Email document.

Parameters:

Parameter Type Description
documentSavingCallback com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback The callback to estimate the document saving progress.