Warning
從 Windows 10 開始,支援第三方列印提供者的 API 已被取代。 Microsoft不建議對第三方列印提供者進行任何投資。 此外,在提供 v4 列印驅動程式模型的 Windows 8 和較新版本產品上,第三方列印提供者可能無法建立或管理使用 v4 列印驅動程式的佇列。
本主題列出列印提供者可以提供的所有函式。 其中大部分的功能都在 Microsoft Windows SDK 文件中說明。 如果函式是在 Windows 驅動程式套件 (WDK) 中描述,函式名稱會提供相關聯參考頁面的連結。
所有列印提供者都必須提供所有列出函式的指標。 不過,大部分廠商提供的列印提供者都是「部分提供者」,不需要支援函式所定義的許多作業。 Therefore, many of the function pointers can be NULL. 如需部分列印提供者的詳細資訊,請參閱 撰寫網路列印提供者。
在下列函式清單中,必須支援的函式會標示為「必要」。
All print providers must export the initialization function, InitializePrintProvidor. Pointers to all the other functions must be supplied in a PRINTPROVIDOR structure. (請注意,這兩個名稱拼字錯誤,但與標頭檔 Winsplp.h 中出現的名稱一致。
函式分成群組,並在下列各節中呈現:
Initialization function
列印佇列管理功能
印表機驅動程式管理功能
列印工作建立函數
列印工作排程函數
表單管理功能
列印處理器管理功能
列印監視器管理功能
連接埠管理功能
登錄管理功能
Other functions
Initialization function
| Function | Description |
|---|---|
| InitializePrintProvidor (Required) | 初始化列印提供者,並傳回所提供函式的指標。 |
列印佇列管理功能
| Function | Description |
|---|---|
| AddPrinter | 將列印佇列新增至列印提供者所管理的佇列清單,並將列印處理器與列印佇列產生關聯。 |
| AddPrinterConnection | 建立與指定列印佇列的連線。 |
| ClosePrinter (Required) | 停用呼叫端對指定列印佇列的存取。 |
| DeletePrinter | 從列印提供者所管理的佇列清單中刪除列印佇列。 |
| DeletePrinterConnection | 移除與指定列印佇列的連線。 |
| EnumPrinters (Required) | 列舉列印提供者目前所管理的列印佇列清單。 |
| FindClosePrinterChangeNotification | Disables printer change notifications that were enabled by FindFirstPrinterChangeNotification. |
| FindFirstPrinterChangeNotification | 傳回等候物件的控制碼,呼叫端可用來等候指定的印表機事件。 |
| GetPrinter (Required) | 傳回指定列印佇列的目前參數值。 |
| OpenPrinter (Required) | 啟用呼叫端存取指定的列印佇列。 |
| RefreshPrinterChangeNotification | Called by router if client calls FindNextPrinterChangeNotification with the PRINTER_NOTIFY_OPTIONS_REFRESH flag set. |
| ResetPrinter | Modifies a print queue's data type or DEVMODEW structure. |
| SetPrinter (Required) | 設定指定列印佇列的參數。 |
| WaitForPrinterChange | Obsolete. |
印表機驅動程式管理功能
| Function | Description |
|---|---|
| AddPrinterDriver | 將指定印表機的驅動程式檔案新增至指定的伺服器。 |
| AddPrinterDriverEx | Same as AddPrinterDriver, with additional parameters. |
| DeletePrinterDriver | 刪除對指定伺服器上指定印表機驅動程式檔案的存取權。 |
| DeletePrinterDriverEx | Same as DeletePrinterDriver, with additional parameters. |
| EnumPrinterDrivers | Returns a list of printer drivers that have been added to a specified server by calling AddPrinterDriver or AddPrinterDriverEx. |
| GetPrinterDriver | Returns information about a printer driver, which the caller can then pass to AddPrinterDriver. (傳回的資訊通常是從 INF 檔案取得。 |
| [GetPrinterDriverEx | Same as GetPrinterDriver, with additional parameters. |
| GetPrinterDriverDirectory | 傳回伺服器印表機驅動程式目錄的名稱。 |
列印工作建立函數
| Function | Description |
|---|---|
| AbortPrinter (Required) | 嘗試從指定的列印佇列中刪除目前的工作。 |
| AddJob (Required) | 傳回工作識別碼和多工緩衝處理檔案路徑。 The caller uses CreateFile and WriteFile to send data to the spool file. |
| EndDocPrinter (Required) | 執行工作完成作業。 |
| EndPagePrinter | 執行頁面完成作業。 |
| ReadPrinter | 從雙向印表機取得狀態資訊。 |
| ScheduleJob (Required) | 通知提供者可以排程指定的工作。 The job is specified by a job identifier previously returned by AddJob. |
| StartDocPrinter (Required) | 準備列印提供者開始多工緩衝處理列印作業。 |
| StartPagePrinter | 準備列印提供者接收列印工作頁面。 |
| WritePrinter (Required) | 接收列印工作資料流的一部分。 |
Note
The AddJob...ScheduleJob sequence is an alternative to the StartDocPrinter...EndDocPrinter sequence.
列印工作排程函數
| Function | Description |
|---|---|
| EnumJobs (Required) | 傳回排程列印工作的清單。 |
| GetJob (Required) | 傳回工作參數。 |
| SetJob (Required) | 取消、暫停、繼續或重新啟動列印工作,或設定工作參數。 |
表單管理功能
| Function | Description |
|---|---|
| AddForm | 將指定的表單新增至指定印表機可用的表單清單。 |
| DeleteForm | 從指定印表機可用的表單清單中移除指定的表單。 |
| EnumForms | 傳回指定印表機可用的表單清單。 |
| GetForm | 傳回指定表單的特性。 |
| SetForm | 修改指定表單的特徵。 |
列印處理器管理功能
| Function | Description |
|---|---|
| AddPrintProcessor | 在指定的伺服器上安裝列印處理器,並將它新增至列印提供者可以呼叫的列印處理器清單。 |
| DeletePrintProcessor | 從列印提供者可以呼叫的清單中刪除列印處理器。 |
| EnumPrintProcessorDataTypes | 傳回列印提供者可呼叫之列印處理器所支援的資料類型清單。 |
| EnumPrintProcessors | 傳回列印提供者可以呼叫的列印處理器清單。 |
| GetPrintProcessorDirectory | 傳回必須儲存列印處理器檔案的目錄路徑。 |
列印監視器管理功能
| Function | Description |
|---|---|
| AddMonitor | 將列印監視器新增至列印提供者可以呼叫的清單。 |
| DeleteMonitor | 從列印提供者可以呼叫的清單中刪除列印監視器。 |
| EnumMonitors | 傳回列印提供者可以呼叫的列印監視器清單。 |
連接埠管理功能
| Function | Description |
|---|---|
| AddPort | Adds a printer port to the list of those available, typically by calling the specified port monitor's AddPortUI function. |
| AddPortEx(/previous-versions/ff545025(v%3dvs.85)) | Same as AddPort, with additional parameters. |
| ConfigurePort (Required) | Configures a printer port, typically by calling the specified port monitor's ConfigurePortUI function. |
| DeletePort (Required) | Deletes a printer port from the list of those available, typically by calling the specified port monitor's DeletePortUI function. |
| EnumPorts (Required) | 傳回可用印表機連接埠的清單。 |
| SetPort | 設定指定印表機連接埠的參數。 |
登錄管理功能
| Function | Description |
|---|---|
| DeletePrinterData | Deletes the value currently assigned to a specified value name, under the specified printer's PrinterDriverData key. |
| DeletePrinterDataEx | Same as DeletePrinterData, with additional parameters. |
| DeletePrinterKey | Deletes a specified key and its subkeys, if they are currently stored in the registry under the specified printer's PrinterDriverData key. |
| EnumPrinterData | Returns each of the value names and currently assigned values that are stored in the registry under the specified printer's PrinterDriverData key. |
| EnumPrinterDataEx | Same as EnumPrinterData, with additional parameters. |
| EnumPrinterKey | 傳回目前包含在登錄中指定索引鍵名稱下的子機碼清單。 |
| GetPrinterData | Returns the value currently assigned to a specified value name, which is stored in the registry under the specified printer's PrinterDriverData key. |
| GetPrinterDataEx | Same as GetPrinterData, with additional parameters. |
| SetPrinterData | Stores a specified value name and value in the registry, under the specified printer's PrinterDriverData key. |
| SetPrinterDataEx | Same as SetPrinterData, with additional parameters. |
Other functions
| Function | Description |
|---|---|
| XcvData | 提供埠監視器 UI DLL 與埠監視器伺服器 DLL 之間的通訊路徑。 |