System.Printing Namespace

提供可讓您用來自動化管理列印伺服器、列印佇列和列印工作的類別。 Provides classes that enable you to automate the management of print servers, print queues, and print jobs.

Classes

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.Represents the area of a page that can be printed.

PageMediaSize

描述紙張或其他媒體的頁面大小。Describes the page size for paper or other media.

PageResolution

定義列印輸出的頁面解析度,可為質化值、Dot Per Inch (DPI) 或兩者併用。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 將某些屬性認可至物件所代表的實際電腦、印表機或裝置時,發生的例外狀況 (Exception)。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

Defines disposal behavior that is common to both the PrintDriver and PrintProcessor classes.Defines disposal behavior that is common to both the PrintDriver and PrintProcessor classes. PrintFilter supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.PrintFilter supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

PrintingCanceledException

當程式碼嘗試存取已取消的列印工作時,會發生的例外狀況 (Exception)。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

列印工作沒有正常執行時發生的例外狀況 (Exception)。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 時,值回的例外狀況 (Exception)。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 時,發生的例外狀況 (Exception)。The exception that occurs when an error condition prevents the accessing or creation of a PrintServer.

PrintSystemException

當錯誤狀況防止存取或建立 PrintSystemObject 時,發生的例外狀況 (Exception)。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.

Structs

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.

Enums

Collation

指定印表機在列印多頁列印工作的多個複本時是否將輸出自動分頁。Specifies whether a printer collates output when it prints multiple copies of a multi-page print job.

ConflictStatus

指定是否要對合併的 PrintTicket 進行任何變更,以確保 PrintTicket 為可見的。Specifies 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.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.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

Specifies whether a PrintTicket applies to an entire print job, one document within the print job, or just a page within the print job.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.

Remarks

這個命名空間包含下列的核心類別: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每個類別具有CommitRefresh方法。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 Form 的 managed 程式碼開發人員必須使用中的 ApiSystem.Drawing.Printing命名空間。Managed code developers using Windows Forms must use the APIs in the System.Drawing.Printing namespace.

Caution

類別內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.

See also