com.aspose.pdf.printing

Class PdfPrinterSettings



  • public class PdfPrinterSettings
    extends Object
    Specifies information about how a document is printed, including the printer that prints it.
    • Constructor Detail

      • PdfPrinterSettings

        public PdfPrinterSettings()
        Initializes a new instance of the PrinterSettings class.
    • Method Detail

      • getPrinterSettings

        public com.aspose.ms.System.Drawing.Printing.PrinterSettings getPrinterSettings()
        Return PrinterSettings object
        Returns:
        PrinterSettings object
      • canDuplex

        public boolean canDuplex()
        Gets a value indicating whether the printer supports double-sided printing.
        Returns:
        boolean value
      • getDuplex

        public int getDuplex()
        Gets or sets the printer setting for double-sided printing.
        Returns:
        int value
        See Also:
        DuplexKind
      • setDuplex

        public void setDuplex(int value)
        Gets or sets the printer setting for double-sided printing.
        Parameters:
        value - int value
        See Also:
        DuplexKind
      • createMeasurementGraphics

        public Graphics2D createMeasurementGraphics()
        Get Graphics2D object
        Returns:
        Graphics2D object
      • createMeasurementGraphics

        public Graphics2D createMeasurementGraphics(boolean value)
        Get Graphics2D object
        Parameters:
        value - boolean value
        Returns:
        Graphics2D object
      • createMeasurementGraphics

        public Graphics2D createMeasurementGraphics(PrintPageSettings value)
        Get Graphics2D object
        Parameters:
        value - PrintPageSettings value
        Returns:
        Graphics2D object
      • createMeasurementGraphics

        public Graphics2D createMeasurementGraphics(PrintPageSettings pageSettings,
                                                    boolean honorOriginAtMargins)
        Get Graphics2D object
        Parameters:
        pageSettings - PrintPageSettings value
        honorOriginAtMargins - boolean value
        Returns:
        Graphics2D object
      • deepClone

        public PdfPrinterSettings deepClone()
        Get clonned object
        Returns:
        PdfPrinterSettings object
      • isCollate

        public boolean isCollate()
        Gets or sets a value indicating whether the printed document is collated.
        Returns:
        boolean value
      • setCollate

        public void setCollate(boolean value)
        Gets or sets a value indicating whether the printed document is collated.
        Parameters:
        value - boolean value
      • getCopies

        public short getCopies()
        Gets the number of copies of the document to print.
        Returns:
        number of copies
      • setCopies

        public void setCopies(short value)
        Sets the number of copies of the document to print.
        Parameters:
        value - number of copies
      • getDefaultPageSettings

        public PrintPageSettings getDefaultPageSettings()
        Gets the default page settings for this printer.
        Returns:
        default page settings
      • getFromPage

        public int getFromPage()
        Gets or sets the page number of the first page to print.
        Returns:
        int value
      • getLandscapeAngle

        public int getLandscapeAngle()
        Gets the angle, in degrees, that the portrait orientation is rotated to produce the landscape orientation.
        Returns:
        int value
      • getMaximumCopies

        public int getMaximumCopies()
        Gets the maximum number of copies that the printer enables the user to print at a time.
        Returns:
        int value
      • getMaximumPage

        public int getMaximumPage()
        Gets or sets the maximum FromPage or ToPage that can be selected in a PrintDialog.
        Returns:
        int value
      • getMinimumPage

        public int getMinimumPage()
        Gets or sets the minimum FromPage or ToPage that can be selected in a PrintDialog.
        Returns:
        int value
      • getPaperSizes

        public ArrayList<PrintPaperSize> getPaperSizes()
        Gets the paper sizes that are supported by this printer.
        Returns:
        ArrayList<PrintPaperSize> object
      • getPaperSources

        public ArrayList<PrintPaperSource> getPaperSources()
        Gets the paper source trays that are available on the printer.
        Returns:
        ArrayList<PrintPaperSource> object
      • getPrinterName

        public String getPrinterName()
        Gets or sets the name of the printer to use.
        Returns:
        string object
      • getPrinterResolutions

        public com.aspose.ms.System.Drawing.Printing.PrinterSettings.PrinterResolutionCollection getPrinterResolutions()
        Gets all the resolutions that are supported by this printer.
        Returns:
        PrinterResolutionCollection object
      • getPrintFileName

        public String getPrintFileName()
        Gets or sets the file name, when printing to a file.
        Returns:
        string object
      • getPrintRange

        public int getPrintRange()
        Gets or sets the page numbers that the user has specified to be printed.
        Returns:
        int value
        See Also:
        PdfPrintRange
      • isPrintToFile

        public boolean isPrintToFile()
        Gets a value indicating whether the printing output is sent to a file instead of a port.
        Returns:
        boolean value
      • setPrintToFile

        public void setPrintToFile(boolean value)
        Sets a value indicating whether the printing output is sent to a file instead of a port.
        Parameters:
        value - boolean value
      • isSupportsColor

        public boolean isSupportsColor()
        Gets a value indicating whether this printer supports color printing.
        Returns:
        boolean value
      • getToPage

        public int getToPage()
        Gets or sets the number of the last page to print.
        Returns:
        int value
      • getInstalledPrinters

        public static ArrayList<String> getInstalledPrinters()
        Gets the names of all printers installed on the computer.
        Returns:
        ArrayList<String> object
      • isDefaultPrinter

        public boolean isDefaultPrinter()
        Gets a value indicating whether the PrinterName property designates the default printer, except when the user explicitly sets PrinterName.
        Returns:
        boolean value
      • isDirectPrintingSupported

        public boolean isDirectPrintingSupported(String filename)
        Gets a value indicating whether the printer is Supported DirectPrinting
        Parameters:
        filename - String object
        Returns:
        boolean value
      • isDirectPrintingSupported

        public boolean isDirectPrintingSupported(ImageType format)
        Gets a value indicating whether the printer is Supported DirectPrinting
        Parameters:
        format - ImageType object
        Returns:
        boolean value
      • isPlotter

        public boolean isPlotter()
        Gets a value indicating whether the printer is a plotter.
        Returns:
        boolean value
      • isValid

        public boolean isValid()
        Gets a value indicating whether the PrinterName property designates a valid printer.
        Returns:
        boolean value
      • setFromPage

        public void setFromPage(int value)
        Gets or sets the page number of the first page to print.
        Parameters:
        value - int value
      • setMaximumPage

        public void setMaximumPage(int value)
        Gets or sets the maximum FromPage or ToPage that can be selected in a PrintDialog.
        Parameters:
        value - int value
      • setMinimumPage

        public void setMinimumPage(int value)
        Gets or sets the minimum FromPage or ToPage that can be selected in a PrintDialog.
        Parameters:
        value - int value
      • setPrinterName

        public void setPrinterName(String value)
        Sets the name of the printer to use.
        Parameters:
        value - string value
      • setPrintFileName

        public void setPrintFileName(String value)
        Sets the filename to print.
        Parameters:
        value - string value
      • setPrintRange

        public void setPrintRange(int value)
        Sets the page numbers that the user has specified to be printed.
        Parameters:
        value - PdfPrintRange element
        See Also:
        PdfPrintRange
      • setToPage

        public void setToPage(int value)
        Sets the number of the last page to print.
        Parameters:
        value - PdfPrintRange element
        See Also:
        PdfPrintRange
      • setSelectedPages

        public void setSelectedPages(int[] pagesList)
        Sets the number of selected pages to print.
        Parameters:
        pagesList - int array
        See Also:
        PdfPrintRange
      • getSelectedPages

        public int[] getSelectedPages()
        Gets the number of selected pages to print.
        Returns:
        pagesList int array
        See Also:
        PdfPrintRange