public class PdfViewOptions extends ViewOptions
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
}
Viewer,
ViewOptions| Constructor and Description |
|---|
PdfViewOptions()
Initializes a new instance of the
PdfViewOptions class with default settings. |
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(Path outputFilePath)
Initializes a new instance of the
PdfViewOptions class. |
PdfViewOptions(String outputFilePath)
Initializes a new instance of the
PdfViewOptions class. |
| Modifier and Type | Method and Description |
|---|---|
com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback |
getDocumentSavingCallback()
Retrieves the callback used to estimate the progress of saving a Words or Email document.
|
int |
getImageHeight()
Retrieves the height of the output image in pixels.
|
int |
getImageMaxHeight()
Retrieves the maximum height of an output image in pixels.
|
int |
getImageMaxWidth()
Retrieves the maximum width of an output image in pixels.
|
int |
getImageWidth()
Retrieves the width of the output image in pixels.
|
PdfOptimizationOptions |
getPdfOptimizationOptions()
Reduce output PDF file size applying optimization techniques with different options.
|
Security |
getSecurity()
Retrieves the security options for the output PDF document.
|
void |
setDocumentSavingCallback(com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback documentSavingCallback)
Sets the callback used to estimate the progress of saving a Words or Email document.
|
void |
setImageHeight(int imageHeight)
Sets the height of the output image in pixels.
|
void |
setImageMaxHeight(int imageMaxHeight)
Sets the maximum height of an output image in pixels.
|
void |
setImageMaxWidth(int imageMaxWidth)
Sets the maximum width of an output image in pixels.
|
void |
setImageWidth(int imageWidth)
Sets the width of the output image in pixels.
|
void |
setPdfOptimizationOptions(PdfOptimizationOptions pdfOptimizationOptions)
Reduce output PDF file size applying optimization techniques with different options.
|
void |
setSecurity(Security value)
Sets the security options for the output PDF document.
|
getPageRotations, getWatermark, isPageRotationsInitialized_Internal, rotatePage, setWatermarkgetArchiveOptions, getCadOptions, getDefaultFontName, getEmailOptions, getMailStorageOptions, getOutlookOptions, getPdfOptions, getPresentationOptions, getProjectManagementOptions, getSpreadsheetOptions, getTextOptions, getVisioRenderingOptions, getWebDocumentOptions, getWordProcessingOptions, isCadOptionsInitialized_Internal, isRemoveComments, isRenderComments, isRenderHiddenPages, isRenderNotes, setArchiveOptions, setCadOptions, setDefaultFontName, setEmailOptions, setMailStorageOptions, setOutlookOptions, setPdfOptions, setPresentationOptions, setProjectManagementOptions, setRemoveComments, setRenderComments, setRenderHiddenPages, setRenderNotes, setSpreadsheetOptions, setTextOptions, setVisioRenderingOptions, setWebDocumentOptions, setWordProcessingOptionspublic PdfViewOptions()
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.
public PdfViewOptions(CreateFileStream createFileStream)
Initializes a new instance of the PdfViewOptions class.
For the code example, see the documentation.
CreateFileStreampublic PdfViewOptions(CreateFileStream createFileStream, ReleaseFileStream releaseFileStream)
Initializes a new instance of the PdfViewOptions class.
For the code example, see the documentation.
createFileStream - The method used to instantiate the stream for writing the output file data.releaseFileStream - The method used to release the stream created by the createFileStream method.IllegalArgumentException - If createFileStream or releaseFileStream is null.CreateFileStream,
ReleaseFileStreampublic PdfViewOptions(FileStreamFactory fileStreamFactory)
PdfViewOptions class.
For the code example, see the documentation.
fileStreamFactory - The factory that implements methods for creating and releasing the output file stream.IllegalArgumentException - If fileStreamFactory is null.FileStreamFactorypublic PdfViewOptions(Path outputFilePath)
Initializes a new instance of the PdfViewOptions class.
For the code example, see the documentation.
outputFilePath - The path for the output PDF file.IllegalArgumentException - If outputFilePath is null.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.
outputFilePath - The path for the output PDF file.IllegalArgumentException - If outputFilePath is null or empty.public com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback getDocumentSavingCallback()
Retrieves the callback used to estimate the progress of saving a Words or Email document.
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
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
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
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
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 final Security getSecurity()
Retrieves the security options for the output PDF document.
For details, see the documentation.
public void setDocumentSavingCallback(com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback documentSavingCallback)
Sets the callback used to estimate the progress of saving a Words or Email document.
documentSavingCallback - The callback to estimate the document saving progress.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
imageHeight - The height of the output image in pixels.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
imageMaxHeight - The maximum height of the output image in pixels.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
imageMaxWidth - The maximum width of the output image in pixels.public void setImageWidth(int imageWidth)
Sets the width of the output image in pixels. This parameter applies only when converting a single image PDF.
imageWidth - The width of the output image in pixels.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.
pdfOptimizationOptions - PdfOptimizationOptions object or null.public final void setSecurity(Security value)
Sets the security options for the output PDF document.
For details, see the documentation.
value - The security options for the output PDF document.Copyright © 2025. All rights reserved.