com.spire.pdf
Class PrintSettings

java.lang.Object
  extended by com.spire.pdf.PrintSettings

public class PrintSettings
extends java.lang.Object


Constructor Summary
PrintSettings()
          Initializes a new instance of the class.
 
Method Summary
 javax.print.PrintService[] getAllPrinters()
          Get local system all printers
 java.lang.String getPrinter()
          Get printerName
 void printToFile(java.lang.String filename)
          Set printing to file.
 void selectPageRange(int fromPage, int toPage)
          Set print page range.
 void selectSinglePageLayout(PdfSinglePageScalingMode pageScalingMode, boolean autoPortraitOrLandscape, float customScaling)
          Select one page to one paper layout.
 void setPaperMargins(int top, int bottom, int left, int right)
          Set paper margins,measured in hundredths of an inch.
 void setPrinter(java.lang.String printerName)
          Set printerName
 

Constructor Detail

PrintSettings

public PrintSettings()
Initializes a new instance of the class.

Method Detail

getPrinter

public java.lang.String getPrinter()
Get printerName

Returns:
printer name

setPrinter

public void setPrinter(java.lang.String printerName)
Set printerName

Parameters:
printerName -
Throws:
java.awt.print.PrinterException

getAllPrinters

public javax.print.PrintService[] getAllPrinters()
Get local system all printers

Returns:
all Printers

printToFile

public void printToFile(java.lang.String filename)
Set printing to file.

Parameters:
filename - The file name.

selectPageRange

public void selectPageRange(int fromPage,
                            int toPage)
Set print page range.

Parameters:
fromPage - The start page index.
toPage - The end page index

selectSinglePageLayout

public void selectSinglePageLayout(PdfSinglePageScalingMode pageScalingMode,
                                   boolean autoPortraitOrLandscape,
                                   float customScaling)
Select one page to one paper layout.

Parameters:
pageScalingMode - Page scaling mode.
autoPortraitOrLandscape - Indicating whether automatic portrait and landscape.
customScaling - Custom scaling(unit:percent),default value 100f.Valid only if pageScalingMode== PdfSinglePageScalingMode.CustomScale.

setPaperMargins

public void setPaperMargins(int top,
                            int bottom,
                            int left,
                            int right)
Set paper margins,measured in hundredths of an inch.

Parameters:
top - Paper margin top(unit:hundredths of an inch).
bottom - Paper margin bottom(unit:hundredths of an inch).
left - Paper margin left(unit:hundredths of an inch).
right - Paper margin right(unit:hundredths of an inch).