PrintPagesToFileA

Rendering and printing

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to PrintPagesToFile and string arguments are interpreted using the current SetAnsiMode code page

Renders a list of page ranges from the selected document to the specified printer. The print output is directed to the specified spool file

Not all printer drivers support the DocInfo.lpszOutput field so results may vary

Syntax

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);

Parameters

PrinterNameThe name of the printer to use for printing. This is the name that appears in the Windows Print Manager. Use the GetPrinterNames function to return a list of valid printers on the system. A value returned by the NewCustomPrinter function can also be used here. A list of pages to print, for example "1-10,12,14"
PageRanges
OptionsUse the PrintOptions function to obtain a value for this parameter
FileNameUse the PrintOptions function to obtain a value for this parameter

Return values

0An error occurred
1The pages were printed successfully