Printer

Represents a printer that can be used for print jobs.

public class Printer
Public Class Printer

Inheritance: ObjectPrinter

Licensing Info

This class is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

Examples

The following examples creates a print job using a Printer object, sets print job print options based on the Printer object and prints the job.

Imports System
Imports ceTe.DynamicPDF.Printing

Module MyModule

    Sub Main()

        ' Create a printer using its name
        Dim MyPrinter As Printer = New Printer("PrinterName")

        ' Create a print job
        Dim MyPrintJob As PrintJob = New PrintJob(MyPrinter, "C:\MyDocument.pdf")
  
        ' Set the collating if it is supported by the printer
        If (MyPrinter.Collate) Then
            MyPrintJob.PrintOptions.Collate = True
        End If

        ' Set the color if it is supported by the printer
        If (MyPrinter.Color) Then
            MyPrintJob.PrintOptions.Color = True
        End If

        ' Set the duplex  printing if it is supported by the printer
        If (MyPrinter.Duplex) Then
            MyPrintJob.PrintOptions.DuplexMode = DuplexMode.DuplexHorizontal
        End If

        ' Print the job
        MyPrintJob.Print()
    End Sub
End Module
using System;
using ceTe.DynamicPDF.Printing;

class MyClass
{
    static void Main()
    {
        // Create a printer using its name
        Printer printer = new Printer("PrinterName");

        // Create a print job
        PrintJob printJob = new PrintJob(printer, @"C:\MyDocument.pdf");

        // Set the collating if it is supported by the printer
        if (printer.Collate)
        {
            printJob.PrintOptions.Collate = true;
        }

        // Set the color if it is supported by the printer
        if (printer.Color)
        {
            printJob.PrintOptions.Color = true;
        }

        // Set the duplex  printing if it is supported by the printer
        if (printer.Duplex)
        {
            printJob.PrintOptions.DuplexMode = DuplexMode.DuplexHorizontal;
        }

        // Print the job
        printJob.Print();
    }
}

Constructors

Printer(String)Initializes a new instance of the Printer class.

Properties

CollateGets a value indicating if the printer supports collating.
ColorGets a value indicating if the printer supports color printing.
DefaultGets the system's default printer.
DriverNameGets the name of the printer driver.
DriverVersionGets the version of the printer driver.
DuplexGets a value indicating if the printer supports duplex printing.
FaxGets a value indicating if the printer supports fax printing.
MaxCopiesGets the maximum number of copies supported by the printer.
MaxPaperHeightGets the maximum paper height supported by the printer in typesetting points.
MaxPaperWidthGets the maximum paper width supported by the printer in typesetting points.
MediaTypesGets a MediaTypeList object that represents the available media types for the printer.
MinPaperHeightGets the minimum paper height supported by the printer in typesetting points.
MinPaperWidthGets the minimum paper width supported by the printer in typesetting points.
NameGets the name of the printer.
PaperSizesGets a PaperSizeList object that represents the available paper sizes for the printer.
PaperSourcesGets a PaperSourceList object that represents the available paper sources (trays) for the printer.
ResolutionsGets a ResolutionList object that represents the available resolutions for the printer.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetLocalPrinters()Returns an array of the system's local printers.
GetType()Gets the Type of the current instance.
(Inherited from Object)
Refresh()Reinitializes the printer properties in order to update any newly aaded custom paper source, size or any such customizable properties.
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Printing

In this topic