PrintDocumentA

渲染和打印

描述

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

将所选文档的某些页面渲染到指定打印机

语法

Delphi

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

DLL

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

参数

PrinterName用于打印的打印机名称。这是 Windows Print Manager 中显示的名称。使用 GetPrinterNames 函数返回系统中有效打印机列表。此处也可使用 NewCustomPrinter 函数返回的值。要打印的第一页
StartPage
EndPage要打印的最后一页
Options使用 PrintOptions 函数获取此参数的值

返回值

0无法打印页面,通常由 StartPage 和 EndPage 参数超出范围导致
1页面已成功打印