Skip to main content

Printer

Version: 1.0

cete.dynamicpdf.printing.printer

Printer​

  • Namespace: ceTe.DynamicPDF.Printing
  • Assemblies: ceTe.DynamicPDF.Printing.40.x64.dll, ceTe.DynamicPDF.Printing.40.x86.dll

Represents a printer that can be used for print jobs.

public class Printer
Public Class Printer

Inheritance: Object → Printer

Licensing​

This class is a DynamicPDF PrintManager feature. The following license is required for non-evaluation usage:

  • DynamicPDF PrintManager for .NET

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.

public Printer(string printerName)
Public Sub New (printerName As String)

Parameters​

The name of the printer.

Properties​

Collate​

Gets a value indicating if the printer supports collating.

public bool Collate { get; }
Public Property Collate As Boolean

Property Value​

Boolean

Color​

Gets a value indicating if the printer supports color printing.

public bool Color { get; }
Public Property Color As Boolean

Property Value​

Boolean

Default​

Gets the system's default printer.

public static Printer Default { get; }
Public Shared Property Default As Printer

Property Value​

Printer

Duplex​

Gets a value indicating if the printer supports duplex printing.

public bool Duplex { get; }
Public Property Duplex As Boolean

Property Value​

Boolean

Fax​

Gets a value indicating if the printer supports fax printing.

public bool Fax { get; }
Public Property Fax As Boolean

Property Value​

Boolean

MaxCopies​

Gets the maximum number of copies supported by the printer.

public int MaxCopies { get; }
Public Property MaxCopies As Int32

Property Value​

Int32

MaxPaperHeight​

Gets the maximum paper height supported by the printer in typesetting points.

public double MaxPaperHeight { get; }
Public Property MaxPaperHeight As Double

Property Value​

Double

MaxPaperWidth​

Gets the maximum paper width supported by the printer in typesetting points.

public double MaxPaperWidth { get; }
Public Property MaxPaperWidth As Double

Property Value​

Double

MinPaperHeight​

Gets the minimum paper height supported by the printer in typesetting points.

public double MinPaperHeight { get; }
Public Property MinPaperHeight As Double

Property Value​

Double

MinPaperWidth​

Gets the minimum paper width supported by the printer in typesetting points.

public double MinPaperWidth { get; }
Public Property MinPaperWidth As Double

Property Value​

Double

Name​

Gets the name of the printer.

public string Name { get; }
Public Property Name As String

Property Value​

String

PaperSizes​

Gets a PaperSizeList object that represents the available paper sizes for the printer.

public PaperSizeList PaperSizes { get; }
Public Property PaperSizes As PaperSizeList

Property Value​

PaperSizeList

PaperSources​

Gets a PaperSourceList object that represents the available paper sources (trays) for the printer.

public PaperSourceList PaperSources { get; }
Public Property PaperSources As PaperSourceList

Property Value​

PaperSourceList

Resolutions​

Gets a ResolutionList object that represents the available resolutions for the printer.

public ResolutionList Resolutions { get; }
Public Property Resolutions As ResolutionList

Property Value​

ResolutionList

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetLocalPrinters()​

Returns an array of the system's local printers.

public static Printer[] GetLocalPrinters()
Shared Function GetLocalPrinters() As Printer[]

Returns​

An array of Printer objects.

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.Printing