PrintDocRange

Viewer interaction, rendering and printing

Description

Prints StartPage through EndPage on the named printer without any UI, the programmatic sibling of PrintDoc

An empty PrinterName selects the default printer, and out-of-range input is clamped: StartPage below 1 becomes 1, an EndPage below StartPage or beyond the last page becomes the last page, and Copies below 1 becomes 1

Syntax

Delphi

Function TPDFlibViewer.PrintDocRange(Const PrinterName: WideString; StartPage, EndPage, Copies: Integer; Collate: Boolean): Integer;

Parameters

PrinterNameName of the target printer; an empty string selects the default printer
StartPageFirst page to print, 1-based and clamped to 1
EndPageLast page to print, clamped up to the last page
CopiesNumber of copies, clamped to at least 1
CollateTrue collates the copies

Return values

0No document is open, no printer could be resolved, or the job was not handed to the spooler
1The job was handed to the print spooler

See also

PrintDoc, PrintDocumentEx, TPDFlibViewer