PdfViewer

Inheritance: java.lang.Object, com.aspose.pdf.facades.PdfViewer

All Implemented Interfaces: com.aspose.ms.System.IDisposable, IFacade, Closeable, AutoCloseable

public final class PdfViewer extends Object implements IFacade

Represents a class to view or print a pdf.

Fields

FieldDescription
CustomPrint
EndPrintAdds/removes subscription on the last page printing event.
PdfQueryPageSettingsAdds/removes subscription on the last page printing event.

Constructors

ConstructorDescription
PdfViewerInitializes new {@code PdfViewer} object.
PdfViewerInitializes new {@code PdfViewer} object.

Methods

MethodDescription
bindPdfInitializes the facade.
bindPdfInitializes the facade.
bindPdfInitializes the facade.
closeCloses the current Pdf file.
closePdfFileCloses the current Pdf file.
decodeAllPagesGet pages of current pdf file.
decodePageDecodes a page of one Pdf file.
decodePageToImageDecodes page to BufferedImage
disposeDisposes the facade resources. This method is obsolete, use close() instead.
getAutoResizeSets a bool value that indicates whether the file be printed with optimized size.
getAutoRotateGets a bool value that indicates whether the file be printed with auto rotation
getAutoRotateModeGets an AutoRotateMode value that indicates direction of rotation
getCoordinateTypeGets the page coordinate type (Media/Crop boxes). CropBox value is used by default.
getCopiesPrintedGets copies printed
getDefaultPageSettingsGets the default page settings.
getDefaultPrinterSettingsGets the default printer settings.
getFormPresentationModeGets form presentation mode.
getHorizontalAlignmentGets a value that indicates horizontal alignment
getPageCountGets page count of the current Pdf file.
getPasswordGets input document password.
getPrintAsGrayscale

Gets or sets a bool value that indicates whether the page is being printed as grayscale. By default is false.


Default false is false.
getPrintAsImage

Gets a mode for PdfViewer to print as image.

getPrinterJobNameGets name of document in printer queue when document is printed. Default value is file name.
getPrintPageDialogGets a bool value that indicates whether produce the page number dialog when printing.
getPrintStatusGets the result of printing job. If success than null; otherwise, exception object.
getRenderingOptionsGets rendering options.
getResolutionGets or sets resolution during viewing and printing. The higher resolution, the slower speed. The default value is 150. This property changes the image resolution in page-to-image conversion flows: when the {@code PrintAsImage}({@link #getPrintAsImage}/{@link #setPrintAsImage(boolean)}) is set to {@code }, or when {@link #decodePage(int)} or {@link #decodeAllPages} method is called. To set a printer resolution for direct printing to a printer, use the {@code PageSettings.PrinterResolution}({@code PageSettings#getPrinterResolution}/{@code PageSettings#setPrinterResolution(PrinterResolution)}) property in the {@code PageSettings} class.
getScaleFactorGets a floating point value that indicates scale factor. The default value is 1.0.
getUseIntermidiateImageGets the using of conversion of pdf page into intermidiate png file during printing in file mode. Use it when the size of output file is important.
getVerticalAlignmentGets a value that indicates vertical alignment
isShowHiddenAreasThis method is Deprecated Gets flag that controls visibility of hidden areas on the page.
openPdfFile

Opens a Pdf file stream. But does not actually decode the pages of the Pdf file.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile(new FileInputStream(“d:\\test.pdf”))); viewer.closePdfFile(); 
openPdfFile

Opens a Pdf file, but does not actually decode the pages of the Pdf file.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile(“d:\\test.pdf”); viewer.closePdfFile(); 
printDocument

Prints the Pdf document using default printer.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile(“d:\\test.pdf”); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false); //do not produce the page number dialog when printing viewer.printDocument(ps); viewer.closePdfFile(); 
printDocumentWithSettings

Prints the Pdf document with printer settings. The output page size will fit the the document first page size.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile(“d:\\test.pdf”); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false); //do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings().PrinterName()); viewer.printDocumentWithSettings(ps); viewer.closePdfFile(); 
printDocumentWithSettings

Prints the Pdf document with settings. If the document size is not complatible to page size, pdf.kit will extend it to fit page size.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile(“d:\\test.pdf”); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false);//do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings.getPrinterName()); PageSettings pgs = new PageSettings(); pgs.setPaperSize ( new PaperSize(“A4”, 827, 1169)); pgs.setMargins ( new Margins(0, 0, 0, 0)); viewer.printDocumentWithSettings(pgs, ps); viewer.closePdfFile(); 
printLargePdf

Opens and prints a large Pdf stream. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.printPageDialog=false;//do not produce the page number dialog when printing viewer.printLargePdf(new MemoryStream(File.ReadAllBytes(@“d:\test.pdf”))); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.
printLargePdf

Opens and prints a large Pdf stream with specified printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize(true); // print the file with adjusted size viewer.setAutoRotate(true); // print the file with adjusted rotation viewer.setPrintPageDialog(false); // do not produce the page number dialog when // printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName(prtdoc.getPrinterSettings().getPrinterName()); viewer.printLargePdf(new FileInputStream(“d:\\middleware.pdf”), ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.
printLargePdf

Opens and prints a large Pdf stream with specified page settings and printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false);//do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings().getPrinterName()); PageSettings pgs = new PageSettings(); pgs.setPaperSize ( new PaperSize(“A4”, 827, 1169)); pgs.setMargins ( new Margins(0, 0, 0, 0)); viewer.printLargePdf(new FileInputStream(“d:\\middleware.pdf”),pgs,ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.
printLargePdf

Opens and prints a large Pdf file. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize(true); // print the file with adjusted size viewer.setAutoRotate(true); // print the file with adjusted rotation viewer.setPrintPageDialog(false);// do not produce the page number dialog when // printing viewer.setPrintLargePdf(“d:\test.pdf”); 
printLargePdf

Opens and prints a large Pdf file with specified printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false);//do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings().getPrinterName()); viewer.printLargePdf(“d:\\test.pdf”,ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.
printLargePdf

Opens and prints a large Pdf file with specified page settings and printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize(true); // print the file with adjusted size viewer.setAutoRotate(true); // print the file with adjusted rotation viewer.setPrintPageDialog(false); // do not produce the page number dialog when // printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName(prtdoc.getPrinterSettings().getPrinterName()); PageSettings pgs = new PageSettings(); pgs.setPaperSize(new PaperSize(“A4”, 827, 1169)); pgs.setMargins(new Margins(0, 0, 0, 0)); viewer.printLargePdf(“d:\\test.pdf”, pgs, ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.
saveSaves the result PDF document to stream.
saveSaves the result PDF document to file.
setAutoResizeSets a bool value that indicates whether the file be printed with optimized size.
setAutoRotateSets a bool value that indicates whether the file be printed with auto rotation
setAutoRotateModeSets an AutoRotateMode value that indicates direction of rotation
setCoordinateTypeSets the page coordinate type (Media/Crop boxes). CropBox value is used by default.
setFormPresentationModeSets form presentation mode.
setHorizontalAlignmentSets a value that indicates horizontal alignment
setPasswordSets input document password.
setPrintAsGrayscale

Gets or sets a bool value that indicates whether the page is being printed as grayscale. By default is false.


Default false is false.
setPrintAsImage

Sets a mode for PdfViewer to print as image.

setPrinterJobNameSets name of document in printer queue when document is printed. Default value is file name.
setPrintPageDialogSets a boolean value that indicates whether produce the page number dialog when printing.
setRenderingOptionsSets rendering options.
setResolutionSets resolution during viewing and printing. The higher resolution, the slower speed. The default value is 150. This property changes the image resolution in page-to-image conversion flows: when the {@code PrintAsImage}({@link #getPrintAsImage}/{@link #setPrintAsImage(boolean)}) is set to {@code }, or when {@link #decodePage(int)} or {@link #decodeAllPages} method is called. To set a printer resolution for direct printing to a printer, use the {@code PageSettings.PrinterResolution}({@code PageSettings#getPrinterResolution}/{@code PageSettings#setPrinterResolution(PrinterResolution)}) property in the {@code PageSettings} class.
setScaleFactorSets a floating point value that indicates scale factor. The default value is 1.0.
setShowHiddenAreasDeprecated.
setUseIntermidiateImageSets the using of conversion of pdf page into intermidiate png file during printing in file mode. Use it when the size of output file is important.
setVerticalAlignmentSets a value that indicates vertical alignment

CustomPrint

public final com.aspose.ms.lang.Event<com.aspose.ms.System.EventHandler< CustomPrintEventArgs >> CustomPrint

EndPrint

public final PdfEvent <com.aspose.ms.System.Drawing.Printing.PrintEventHandler> EndPrint

Adds/removes subscription on the last page printing event.

PdfQueryPageSettings

public final PdfEvent < PdfQueryPageSettingsEventHandler > PdfQueryPageSettings

Adds/removes subscription on the last page printing event.

PdfViewer

public PdfViewer()

Initializes new {@code PdfViewer} object.

PdfViewer

Initializes new {@code PdfViewer} object.

bindPdf

Initializes the facade.

bindPdf

Initializes the facade.

bindPdf

Initializes the facade.

close

public void close()

Closes the current Pdf file.

closePdfFile

public void closePdfFile()

Closes the current Pdf file.

decodeAllPages

public BufferedImage [] decodeAllPages()

Get pages of current pdf file.

Returns: return the array of Pdf page images.

decodePage

public BufferedImage decodePage(int pageNumber)

Decodes a page of one Pdf file.

Parameters:

ParameterTypeDescription
pageNumberThe page number of one Pdf file which must be between 1 and PageCount.

Returns: return the Pdf page image.

decodePageToImage

Decodes page to BufferedImage

dispose

@Deprecated public void dispose()

Disposes the facade resources. This method is obsolete, use close() instead.

getAutoResize

public boolean getAutoResize()

Sets a bool value that indicates whether the file be printed with optimized size.

Returns: boolean value: If false print page without page scaling. If true print page with scaling to fit to printable area.

getAutoRotate

public boolean getAutoRotate()

Gets a bool value that indicates whether the file be printed with auto rotation

Returns: boolean value

getAutoRotateMode

public int getAutoRotateMode()

Gets an AutoRotateMode value that indicates direction of rotation

Returns: AutoRotateMode element @see AutoRotateMode

getCoordinateType

public PageCoordinateType getCoordinateType()

Gets the page coordinate type (Media/Crop boxes). CropBox value is used by default.

Returns: PageCoordinateType element @see PageCoordinateType

getCopiesPrinted

public int getCopiesPrinted()

Gets copies printed

Returns: int value

getDefaultPageSettings

public PrintPageSettings getDefaultPageSettings()

Gets the default page settings.

Returns: Page settings object.

getDefaultPrinterSettings

public PdfPrinterSettings getDefaultPrinterSettings()

Gets the default printer settings.

Returns: Page settings object.

getFormPresentationMode

public int getFormPresentationMode()

Gets form presentation mode.

Returns: FormPresentationMode element @see FormPresentationMode

getHorizontalAlignment

public HorizontalAlignment getHorizontalAlignment()

Gets a value that indicates horizontal alignment

Returns: HorizontalAlignment element @see HorizontalAlignment

getPageCount

public int getPageCount()

Gets page count of the current Pdf file.

Returns: return page count.

getPassword

public String getPassword()

Gets input document password.

Returns: String value

getPrintAsGrayscale

public boolean getPrintAsGrayscale()

Gets or sets a bool value that indicates whether the page is being printed as grayscale. By default is false.


Default false is false.

Returns: boolean value

getPrintAsImage

public boolean getPrintAsImage()

Gets a mode for PdfViewer to print as image.

Returns: boolean value


If true prints always as image (generates image that is printed) If false prints directly to device if all features are supported. In case document contains non-supported features the system may automatically decide to print as image. Default falue is false.

getPrinterJobName

public String getPrinterJobName()

Gets name of document in printer queue when document is printed. Default value is file name.

Returns: String value

getPrintPageDialog

public boolean getPrintPageDialog()

Gets a bool value that indicates whether produce the page number dialog when printing.

Returns: boolean value

getPrintStatus

public Object getPrintStatus()

Gets the result of printing job. If success than null; otherwise, exception object.

Returns: exception object or null

getRenderingOptions

public RenderingOptions getRenderingOptions()

Gets rendering options.

Returns: RenderingOptions object

getResolution

public int getResolution()

Gets or sets resolution during viewing and printing. The higher resolution, the slower speed. The default value is 150. This property changes the image resolution in page-to-image conversion flows: when the {@code PrintAsImage}({@link #getPrintAsImage}/{@link #setPrintAsImage(boolean)}) is set to {@code }, or when {@link #decodePage(int)} or {@link #decodeAllPages} method is called. To set a printer resolution for direct printing to a printer, use the {@code PageSettings.PrinterResolution}({@code PageSettings#getPrinterResolution}/{@code PageSettings#setPrinterResolution(PrinterResolution)}) property in the {@code PageSettings} class.

Returns: int value

getScaleFactor

public float getScaleFactor()

Gets a floating point value that indicates scale factor. The default value is 1.0.

Returns: floating point value.

getUseIntermidiateImage

public boolean getUseIntermidiateImage()

Gets the using of conversion of pdf page into intermidiate png file during printing in file mode. Use it when the size of output file is important.

Returns: boolean value.

getVerticalAlignment

public VerticalAlignment getVerticalAlignment()

Gets a value that indicates vertical alignment

Returns: VerticalAlignment element @see VerticalAlignment

isShowHiddenAreas

@Deprecated public boolean isShowHiddenAreas()

This method is Deprecated Gets flag that controls visibility of hidden areas on the page.

Returns: boolean value

openPdfFile

Opens a Pdf file stream. But does not actually decode the pages of the Pdf file.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile(new FileInputStream("d:\\test.pdf"))); viewer.closePdfFile(); 

openPdfFile

Opens a Pdf file, but does not actually decode the pages of the Pdf file.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile("d:\\test.pdf"); viewer.closePdfFile(); 

printDocument

public void printDocument()

Prints the Pdf document using default printer.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile("d:\\test.pdf"); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false); //do not produce the page number dialog when printing viewer.printDocument(ps); viewer.closePdfFile(); 

printDocumentWithSettings

Prints the Pdf document with printer settings. The output page size will fit the the document first page size.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile("d:\\test.pdf"); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false); //do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings().PrinterName()); viewer.printDocumentWithSettings(ps); viewer.closePdfFile(); 

printDocumentWithSettings

Prints the Pdf document with settings. If the document size is not complatible to page size, pdf.kit will extend it to fit page size.


 PdfViewer viewer = new PdfViewer(); viewer.openPdfFile("d:\\test.pdf"); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false);//do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings.getPrinterName()); PageSettings pgs = new PageSettings(); pgs.setPaperSize ( new PaperSize("A4", 827, 1169)); pgs.setMargins ( new Margins(0, 0, 0, 0)); viewer.printDocumentWithSettings(pgs, ps); viewer.closePdfFile(); 

printLargePdf

Opens and prints a large Pdf stream. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.printPageDialog=false;//do not produce the page number dialog when printing viewer.printLargePdf(new MemoryStream(File.ReadAllBytes(@"d:\test.pdf"))); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.

printLargePdf

Opens and prints a large Pdf stream with specified printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize(true); // print the file with adjusted size viewer.setAutoRotate(true); // print the file with adjusted rotation viewer.setPrintPageDialog(false); // do not produce the page number dialog when // printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName(prtdoc.getPrinterSettings().getPrinterName()); viewer.printLargePdf(new FileInputStream("d:\\middleware.pdf"), ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.

printLargePdf

Opens and prints a large Pdf stream with specified page settings and printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false);//do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings().getPrinterName()); PageSettings pgs = new PageSettings(); pgs.setPaperSize ( new PaperSize("A4", 827, 1169)); pgs.setMargins ( new Margins(0, 0, 0, 0)); viewer.printLargePdf(new FileInputStream("d:\\middleware.pdf"),pgs,ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.

printLargePdf

Opens and prints a large Pdf file. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize(true); // print the file with adjusted size viewer.setAutoRotate(true); // print the file with adjusted rotation viewer.setPrintPageDialog(false);// do not produce the page number dialog when // printing viewer.setPrintLargePdf("d:\test.pdf"); 

printLargePdf

Opens and prints a large Pdf file with specified printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize ( true); //print the file with adjusted size viewer.setAutoRotate ( true); //print the file with adjusted rotation viewer.setPrintPageDialog ( false);//do not produce the page number dialog when printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName ( prtdoc.getPrinterSettings().getPrinterName()); viewer.printLargePdf("d:\\test.pdf",ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.

printLargePdf

Opens and prints a large Pdf file with specified page settings and printer settings. If your Pdf file has hundreds of pages or more or its size is more than 3 MB, this method is recommended to get better performance.


 PdfViewer viewer = new PdfViewer(); viewer.setAutoResize(true); // print the file with adjusted size viewer.setAutoRotate(true); // print the file with adjusted rotation viewer.setPrintPageDialog(false); // do not produce the page number dialog when // printing PrinterSettings ps = new PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.setPrinterName(prtdoc.getPrinterSettings().getPrinterName()); PageSettings pgs = new PageSettings(); pgs.setPaperSize(new PaperSize("A4", 827, 1169)); pgs.setMargins(new Margins(0, 0, 0, 0)); viewer.printLargePdf("d:\\test.pdf", pgs, ps); viewer.closePdfFile(); 

This method has integrated the opening and the printing of the file and you need not calling the OpenPdfFile() explicitly.

save

Saves the result PDF document to stream.

save

Saves the result PDF document to file.

setAutoResize

public void setAutoResize(boolean value)

Sets a bool value that indicates whether the file be printed with optimized size.

Parameters:

ParameterTypeDescription
valueboolean value: If false print page without page scaling. If true print page with scaling to fit to printable area.

setAutoRotate

public void setAutoRotate(boolean value)

Sets a bool value that indicates whether the file be printed with auto rotation

Parameters:

ParameterTypeDescription
valueboolean value

setAutoRotateMode

public void setAutoRotateMode(int value)

Sets an AutoRotateMode value that indicates direction of rotation

Parameters:

ParameterTypeDescription
valueAutoRotateMode element @see AutoRotateMode

setCoordinateType

Sets the page coordinate type (Media/Crop boxes). CropBox value is used by default.

setFormPresentationMode

public void setFormPresentationMode(int value)

Sets form presentation mode.

Parameters:

ParameterTypeDescription
valueFormPresentationMode element

setHorizontalAlignment

Sets a value that indicates horizontal alignment

setPassword

Sets input document password.

setPrintAsGrayscale

public void setPrintAsGrayscale(boolean value)

Gets or sets a bool value that indicates whether the page is being printed as grayscale. By default is false.


Default false is false.

Parameters:

ParameterTypeDescription
valueboolean value

setPrintAsImage

public void setPrintAsImage(boolean value)

Sets a mode for PdfViewer to print as image.

Parameters:

ParameterTypeDescription
valueboolean value
If true prints always as image (generates image that is printed) If false prints directly to device if all features are supported. In case document contains non-supported features the system may automatically decide to print as image. Default falue is false.

setPrinterJobName

Sets name of document in printer queue when document is printed. Default value is file name.

setPrintPageDialog

public void setPrintPageDialog(boolean value)

Sets a boolean value that indicates whether produce the page number dialog when printing.

Parameters:

ParameterTypeDescription
valueboolean value

setRenderingOptions

Sets rendering options.

setResolution

public void setResolution(int value)

Sets resolution during viewing and printing. The higher resolution, the slower speed. The default value is 150. This property changes the image resolution in page-to-image conversion flows: when the {@code PrintAsImage}({@link #getPrintAsImage}/{@link #setPrintAsImage(boolean)}) is set to {@code }, or when {@link #decodePage(int)} or {@link #decodeAllPages} method is called. To set a printer resolution for direct printing to a printer, use the {@code PageSettings.PrinterResolution}({@code PageSettings#getPrinterResolution}/{@code PageSettings#setPrinterResolution(PrinterResolution)}) property in the {@code PageSettings} class.

Parameters:

ParameterTypeDescription
valueint value

setScaleFactor

public void setScaleFactor(float value)

Sets a floating point value that indicates scale factor. The default value is 1.0.

Parameters:

ParameterTypeDescription
valuefloating point value.

setShowHiddenAreas

@Deprecated public void setShowHiddenAreas(boolean value)

Deprecated.

Parameters:

ParameterTypeDescription
value

setUseIntermidiateImage

public void setUseIntermidiateImage(boolean value)

Sets the using of conversion of pdf page into intermidiate png file during printing in file mode. Use it when the size of output file is important.

Parameters:

ParameterTypeDescription
valueboolean value.

setVerticalAlignment

Sets a value that indicates vertical alignment