PrintDocumentToFileA

渲染和列印

描述

結尾的 A 表示 ANSI(char)DLL 進入點;ActiveX/COM 介面只提供 Unicode 形式。行為與 PrintDocumentToFile 完全相同,字串參數依目前 SetAnsiMode 的字碼頁解讀

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

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

語法

Delphi

Function DLPrintDocumentToFileA(InstanceID: Integer; PrinterName: PAnsiChar; StartPage, EndPage, Options: Integer; FileName: PAnsiChar): Integer;

DLL

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

參數

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