PrintPagesToFileA

渲染和打印

描述

末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式。其行为与 PrintPagesToFile 相同,字符串参数按当前 SetAnsiMode 代码页解释

将选定文档中的页面范围列表渲染到指定打印机。打印输出定向到指定的假脱机文件

并非所有打印机驱动程序都支持 DocInfo.lpszOutput 字段,因此结果可能有所不同

语法

Delphi

Function DLPrintPagesToFileA(InstanceID: Integer; PrinterName, PageRanges: PAnsiChar; Options: Integer; FileName: PAnsiChar): Integer;

DLL

int DLPrintPagesToFileA(int InstanceID, const char * PrinterName, const char * PageRanges, int Options, const char * FileName);

参数

PrinterName用于打印的打印机名称,此名称显示在 Windows 打印管理器中,使用 GetPrinterNames 返回系统中有效打印机列表,也可在此使用 NewCustomPrinter 返回的值;要打印的页面列表,例如 "1-10,12,14"
PageRanges
Options使用 PrintOptions 函数获取此参数的值
FileName使用 PrintOptions 函数获取此参数的值

返回值

0发生错误
1页面已成功打印