PrintDocumentToFile

渲染和列印

描述

把所選文件的指定頁面描繪到指定印表機,列印輸出導向指定的 spool 檔案

並非所有印表機驅動程式都支援 DocInfo.lpszOutput 欄位,結果可能各有不同

語法

Delphi

Function TPDFlib.PrintDocumentToFile(Const PrinterName: WideString; StartPage, EndPage, Options: Integer; Const FileName: WideString): Integer;

ActiveX

Function PDFlib::PrintDocumentToFile(PrinterName As String, StartPage As Long, EndPage As Long, Options As Long, FileName As String) As Long

DLL

int DLPrintDocumentToFile(int InstanceID, const wchar_t* PrinterName, int StartPage, int EndPage, int Options, const wchar_t* FileName);
int DLPrintDocumentToFileA(int InstanceID, const char* PrinterName, int StartPage, int EndPage, int Options, const char* FileName);

參數

PrinterName列印要使用的印表機名稱,就是 Windows 列印管理員中顯示的名稱。可用 GetPrinterNames 函式取得系統上有效印表機的清單,NewCustomPrinter 函式傳回的值也可以用在這裡
StartPage要列印的第一頁
EndPage要列印的最後一頁
Options此參數的值請用 PrintOptions 函式取得
FileName列印輸出要 spool 到的檔名。

傳回值

列印工作以輸出重新導向至多工緩衝檔案的方式送出後傳回 1。印表機名稱無效或列印工作失敗、被取消時傳回 0。