System.Printing Namespace

提供可用于自动管理打印服务器、打印队列和打印作业的类。 Provides classes that enable you to automate the management of print servers, print queues, and print jobs.

LocalPrintServer

表示本地打印服务器(应用程序正在其上运行的计算机)和启用其打印队列的管理。Represents the local print server (the computer on which your application is running) and enables management of its print queues.

PageImageableArea

表示页面可打印区域。Represents the area of a page that can be printed.

PageMediaSize

描述纸张或其他介质的页大小。Describes the page size for paper or other media.

PageResolution

将打印输出的页面分辨率定义为定性值和/或每英寸点数。Defines the page resolution of printed output as either a qualitative value or as dots per inch, or both.

PageScalingFactorRange

指定打印机可在页面上放大或缩小打印图像的百分比范围。Specifies a range of percentages by which a printer can enlarge or reduce the print image on a page.

PrintCapabilities

定义打印机的功能。Defines the capabilities of a printer.

PrintCommitAttributesException

错误情况阻止 PrintSystemObject 将某些特性提交到对象表示的实际计算机、打印机或设备时引发的异常。The exception that is thrown when an error condition prevents some attributes from being committed by a PrintSystemObject to the actual computer, printer, or device that the object represents.

PrintDocumentImageableArea

指定纸张(或其他介质)大小,成像区域大小以及成像区域的位置。Specifies the size of the paper (or other media), the size of the imageable area, and the location of the imageable area.

PrintDriver

表示打印驱动程序。Represents a print driver.

PrintFilter

定义 PrintDriverPrintProcessor 类所共有的处置行为。Defines disposal behavior that is common to both the PrintDriver and PrintProcessor classes. PrintFilter 支持 Windows Presentation Foundation (WPF) 基础结构,不应在代码中直接使用。PrintFilter supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

PrintingCanceledException

代码尝试访问已取消的打印作业时出现的异常。The exception that occurs when code attempts to access a canceled print job.

PrintingNotSupportedException

当打印操作不受支持时引发的异常。The exception that is thrown when a printing operation is not supported.

PrintJobException

在打印作业没有正确运行时发生的异常。The exception that occurs when the print job does not run correctly.

PrintJobInfoCollection

表示一个或多个 PrintSystemJobInfo 对象。Represents one or more PrintSystemJobInfo objects.

PrintJobSettings

描述打印作业。Describes a print job.

PrintPort

表示打印服务器上的打印机端口。Represents a printer port on a print server. 每个打印队列都具有分配的打印端口。Each print queue has a print port assigned to it.

PrintProcessor

表示打印服务器上的打印处理器。Represents a print processor on a print server.

PrintQueue

管理打印机和打印作业。Manages printers and print jobs.

PrintQueueCollection

表示 PrintQueue 对象集合。Represents a collection of PrintQueue objects.

PrintQueueException

在错误情况阻止访问或创建 PrintQueue 时引发的异常。The exception that is thrown when an error condition prevents the accessing or creation of a PrintQueue.

PrintQueueStream

一个流,表示打印队列中进行后台处理的打印作业。A stream that represents a spooled print job in a print queue.

PrintQueueStringProperty

表示打印队列的三个可能属性中的一个(且只有一个)属性:LocationCommentShareNameRepresents one, and only one, of three possible properties of a print queue: Location, Comment, or ShareName.

PrintServer

在打印服务器(通常是一台计算机,但也可能是专用硬件打印服务器设备)上管理打印队列。Manages the print queues on a print server, which is usually a computer, but can be a dedicated hardware print server appliance.

PrintServerException

错误情况阻止访问或创建 PrintServer 时引发的异常。The exception that occurs when an error condition prevents the accessing or creation of a PrintServer.

PrintSystemException

在错误条件阻止访问或创建 PrintSystemObject 时发生的异常。The exception that occurs when an error condition prevents accessing or creating a PrintSystemObject.

PrintSystemJobInfo

详细定义打印作业。Defines a print job in detail.

PrintSystemObject

定义打印系统对象所共有的基本属性和方法。Defines basic properties and methods that are common to the objects of the printing system. 从此类派生的类表示诸如打印队列、打印服务器和打印作业之类的对象。Classes that derive from this class represent such objects as print queues, print servers, and print jobs.

PrintSystemObjectPropertiesChangedEventArgs

为必须创建的 PropertiesChanged 事件提供数据。Provides data for a PropertiesChanged event, which you must create.

PrintSystemObjectPropertyChangedEventArgs

为必须创建的 PropertyChanged 事件提供数据。Provides data for a PropertyChanged event, which you must create.

PrintSystemObjects

代表打印系统对象的集合。Represents a collection of print system objects.

PrintTicket

定义打印作业的设置。Defines the settings of a print job.

结构

ValidationResult

表示保证可行的合并 PrintTicket,并包含为使其可行而更改的任何设置的报告。Represents a merged PrintTicket that is guaranteed to be viable, with a report of any settings that were changed to make it viable.

枚举

Collation

指定打印机在打印多页打印作业的多个副本时是否逐份打印输出。Specifies whether a printer collates output when it prints multiple copies of a multi-page print job.

ConflictStatus

指定是否对合并 PrintTicket 进行任何更改,以确保获得可行的 PrintTicketSpecifies whether any changes were made to a merged PrintTicket to ensure a viable PrintTicket.

DeviceFontSubstitution

指定是否在打印机上启用设备字体替换。Specifies whether device font substitution is enabled on a printer.

Duplexing

指定打印机是使用单面打印,还是使用某种类型的双面(双工打印)打印。Specifies whether a printer uses one-sided printing or some type of two-sided (duplex) printing.

EnumeratedPrintQueueTypes

指定打印队列的特性。Specifies attributes of print queues.

InputBin

指定用作空白纸或其他打印介质源的送纸盒。Specifies the input bin that is used as the source of blank paper or other print media.

LocalPrintServerIndexedProperty

指定在构造 LocalPrintServer 对象时初始化的该对象的属性。Specifies the properties of a LocalPrintServer object that are initialized when it is constructed.

OutputColor

指定如何打印包含彩色或灰阶的内容。Specifies how to print content that contains color or shades of gray.

OutputQuality

指定打印设备输出质量的类型。Specifies the types of output quality for a print device.

PageBorderless

指定打印设备是打印到介质边缘,还是在边缘周围留出一定的空白不打印。Specifies whether a print device prints to the edge of the media or provides an unprinted margin around the edge.

PageMediaSizeName

指定纸张或其他打印介质的页大小或纸张宽度。Specifies the page size or roll width of the paper or other print media.

PageMediaType

指定打印纸张或其他介质的类型。Specifies types of printing paper or other media.

PageOrder

指定打印设备是从前往后还是从后往前打印多页文档。Specifies whether a print device prints multi-page documents from front-to-back or back-to-front.

PageOrientation

指定如何在打印介质上确定内容页的方向。Specifies how pages of content are oriented on print media.

PageQualitativeResolution

将页面的分辨率指定为定性的非数字值。Specifies the page resolution as a qualitative, non-numerical, value.

PagesPerSheetDirection

指定在打印介质单面上显示多页内容时的页面排列。Specifies the arrangement of pages when more than one page of content appears on a single side of print media.

PhotoPrintingIntent

指定打印照片时的输出质量。 打印机驱动程序将 PhotoPrintingIntent 转换为分辨率和其他质量因素的定性值。The printer driver translates the PhotoPrintingIntent into quantitative values for resolution and other quality factors.

PrintJobPriority

指定某打印作业相对于打印队列中的其他打印作业的非数字优先级。Specifies a non-numerical priority for a print job relative to other print jobs in the print queue.

PrintJobStatus

指定打印队列中打印作业的当前状态。Specifies the current status of a print job in a print queue.

PrintJobType

指定打印作业是否使用 XML 纸张规范 (XPS)。Specifies whether the print job uses XML Paper Specification (XPS).

PrintQueueAttributes

指定打印队列及其打印机的特性。Specifies the attributes of a print queue and its printer.

PrintQueueIndexedProperty

指定在构建 PrintQueue 对象时初始化的属性。Specifies the properties that are initialized when a PrintQueue object is constructed.

PrintQueueStatus

指定打印队列或其打印机的状态。Specifies the status of a print queue or its printer.

PrintQueueStringPropertyType

指定 PrintQueueStringProperty 的预期含义。Specifies the intended meaning of a PrintQueueStringProperty.

PrintServerEventLoggingTypes

指定可以由 PrintServer 记录的事件的类型。Specifies the types of events that can be logged by a PrintServer.

PrintServerIndexedProperty

指定在构造 PrintServer 对象时初始化的该对象的属性。Specifies the properties of a PrintServer object that are initialized when it is constructed.

PrintSystemDesiredAccess

指定打印对象的不同访问权限(或访问级别)。Specifies the different access rights (or levels of access) for printing objects.

PrintSystemObjectLoadMode

指定对象属性是否在对象加载时进行初始化。Specifies whether the properties of an object are initialized when the object loads.

PrintTicketScope

指定 PrintTicket 是适用于整个打印作业、打印作业中的一个文档,还是仅适用于打印作业中的一页。Specifies whether a PrintTicket applies to an entire print job, one document within the print job, or just a page within the print job.

Stapling

指定打印机是否装订多页文档,并在什么位置装订。Specifies whether, and where, a printer staples a multi-page document.

TrueTypeFontMode

指定打印机对格式为 TrueType 字体的文本的处理方式。Specifies how a printer handles text that is formatted with a TrueType font.

注解

此命名空间包含以下核心类:This namespace contains the following core classes:

  • PrintSystemObject类,该类是其他核心打印类的基类。The PrintSystemObject class, which is the base class for the other core printing classes.

  • PrintServer类,该类表示实际的打印服务器,通常一台计算机。The PrintServer class, which represents an actual print server, usually a computer.

  • PrintQueue类,该类表示实际的打印队列和其打印机。The PrintQueue class, which represents an actual print queue and its printer.

  • PrintSystemJobInfo类,该类表示特定的打印作业。The PrintSystemJobInfo class, which represents a particular print job.

  • PrintTicket类,它指示打印机如何处理打印作业。The PrintTicket class, which instructs the printer how to process a print job.

类派生自PrintSystemObject每个类具有Commit和一个Refresh方法。Classes derived from the PrintSystemObject class each have a Commit and a Refresh method. 必须使用这些方法以确保与它们所代表的硬件或软件组件进行同步的类的实例。You must use these methods to ensure that instances of the classes are synchronized with the hardware or software components that they represent.

System.Printing命名空间还包括许多枚举描述打印机功能,如打印机是否可以生成逐份打印输出,并指定到打印机,如用于打印作业的纸张大小的说明。The System.Printing namespace also includes many enumerations that describe printer capabilities, such as whether a printer can produce collated output, and that specify instructions to printers, such as the paper size to use for a print job.

此命名空间是使用 Windows Presentation Foundation 提供的增强打印服务的一部分。This namespace is part of the enhanced printing services provided with Windows Presentation Foundation. 使用 Windows 窗体的托管的代码开发人员必须使用中的 ApiSystem.Drawing.Printing命名空间。Managed code developers using Windows Forms must use the APIs in the System.Drawing.Printing namespace.

注意

类中System.Printing命名空间不支持的 Windows 服务或 ASP.NET 应用程序或服务中的使用。Classes within the System.Printing namespace are not supported for use within a Windows service or ASP.NET application or service. 尝试使用在这些应用程序类型之一中的这些类可能会产生意外的问题,如降低服务性能和运行时异常。Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.