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
| Field | Description |
|---|---|
| CustomPrint | |
| EndPrint | Adds/removes subscription on the last page printing event. |
| PdfQueryPageSettings | Adds/removes subscription on the last page printing event. |
Constructors
| Constructor | Description |
|---|---|
| PdfViewer | Initializes new {@code PdfViewer} object. |
| PdfViewer | Initializes new {@code PdfViewer} object. |
Methods
| Method | Description |
|---|---|
| bindPdf | Initializes the facade. |
| bindPdf | Initializes the facade. |
| bindPdf | Initializes the facade. |
| close | Closes the current Pdf file. |
| closePdfFile | Closes the current Pdf file. |
| decodeAllPages | Get pages of current pdf file. |
| decodePage | Decodes a page of one Pdf file. |
| decodePageToImage | Decodes page to BufferedImage |
| dispose | Disposes the facade resources. This method is obsolete, use close() instead. |
| getAutoResize | Sets a bool value that indicates whether the file be printed with optimized size. |
| getAutoRotate | Gets a bool value that indicates whether the file be printed with auto rotation |
| getAutoRotateMode | Gets an AutoRotateMode value that indicates direction of rotation |
| getCoordinateType | Gets the page coordinate type (Media/Crop boxes). CropBox value is used by default. |
| getCopiesPrinted | Gets copies printed |
| getDefaultPageSettings | Gets the default page settings. |
| getDefaultPrinterSettings | Gets the default printer settings. |
| getFormPresentationMode | Gets form presentation mode. |
| getHorizontalAlignment | Gets a value that indicates horizontal alignment |
| getPageCount | Gets page count of the current Pdf file. |
| getPassword | Gets 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. |
| getPrinterJobName | Gets name of document in printer queue when document is printed. Default value is file name. |
| getPrintPageDialog | Gets a bool value that indicates whether produce the page number dialog when printing. |
| getPrintStatus | Gets the result of printing job. If success than null; otherwise, exception object. |
| getRenderingOptions | Gets rendering options. |
| 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. |
| getScaleFactor | Gets a floating point value that indicates scale factor. The default value is 1.0. |
| 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. |
| getVerticalAlignment | Gets a value that indicates vertical alignment |
| isShowHiddenAreas | This 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. |
| save | Saves the result PDF document to stream. |
| save | Saves the result PDF document to file. |
| setAutoResize | Sets a bool value that indicates whether the file be printed with optimized size. |
| setAutoRotate | Sets a bool value that indicates whether the file be printed with auto rotation |
| setAutoRotateMode | Sets an AutoRotateMode value that indicates direction of rotation |
| setCoordinateType | Sets the page coordinate type (Media/Crop boxes). CropBox value is used by default. |
| setFormPresentationMode | Sets form presentation mode. |
| setHorizontalAlignment | Sets a value that indicates horizontal alignment |
| setPassword | Sets 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. |
| setPrinterJobName | Sets name of document in printer queue when document is printed. Default value is file name. |
| setPrintPageDialog | Sets a boolean value that indicates whether produce the page number dialog when printing. |
| setRenderingOptions | Sets rendering options. |
| setResolution | 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. |
| setScaleFactor | Sets a floating point value that indicates scale factor. The default value is 1.0. |
| setShowHiddenAreas | Deprecated. |
| setUseIntermidiateImage | 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. |
| setVerticalAlignment | Sets 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:
| Parameter | Type | Description |
|---|---|---|
| pageNumber | The 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
setAutoRotateMode
public void setAutoRotateMode(int value)
Sets an AutoRotateMode value that indicates direction of rotation
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | AutoRotateMode 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:
| Parameter | Type | Description |
|---|---|---|
| value | FormPresentationMode 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
setPrintAsImage
public void setPrintAsImage(boolean value)
Sets a mode for PdfViewer to print as image.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | 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. |
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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | int value |
setScaleFactor
public void setScaleFactor(float value)
Sets a floating point value that indicates scale factor. The default value is 1.0.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | floating point value. |
setShowHiddenAreas
@Deprecated public void setShowHiddenAreas(boolean value)
Deprecated.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value. |
setVerticalAlignment
Sets a value that indicates vertical alignment