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:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Collate | Gets a value indicating if the printer supports collating. |
Color | Gets a value indicating if the printer supports color printing. |
Default | Gets the system's default printer. |
DriverName | Gets the name of the printer driver. |
DriverVersion | Gets the version of the printer driver. |
Duplex | Gets a value indicating if the printer supports duplex printing. |
Fax | Gets a value indicating if the printer supports fax printing. |
MaxCopies | Gets the maximum number of copies supported by the printer. |
MaxPaperHeight | Gets the maximum paper height supported by the printer in typesetting points. |
MaxPaperWidth | Gets the maximum paper width supported by the printer in typesetting points. |
MediaTypes | Gets a MediaTypeList object that represents the available media types for the printer. |
MinPaperHeight | Gets the minimum paper height supported by the printer in typesetting points. |
MinPaperWidth | Gets the minimum paper width supported by the printer in typesetting points. |
Name | Gets the name of the printer. |
PaperSizes | Gets a PaperSizeList object that represents the available paper sizes for the printer. |
PaperSources | Gets a PaperSourceList object that represents the available paper sources (trays) for the printer. |
Resolutions | Gets 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) |