PrintDocumentToFileA
渲染和打印
描述
末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式。其行为与 PrintDocumentToFile 相同,字符串参数使用当前 SetAnsiMode 代码页解释
将所选文档的特定页面渲染到指定打印机。打印输出会定向到指定的后台处理文件
并非所有打印机驱动程序都支持 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 函数返回的值 |
|---|---|
| StartPage | 要打印的第一页 |
| EndPage | 要打印的最后一页 |
| Options | 使用 PrintOptions 函数获取此参数的值 |
| FileName | 打印输出应假脱机到的文件名 |