PrintDocumentToFile
渲染和打印
描述
将所选文档的特定页面渲染到指定打印机。打印输出会定向到指定的后台处理文件
并非所有打印机驱动程序都支持 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 | 打印输出应假脱机到的文件名 |
返回值
打印作业以输出重定向到后台文件的方式发送后返回 1。打印机名称无效或打印作业失败、被取消时返回 0。