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
| PrinterName | Name of the target printer; an empty string selects the default printer |
|---|---|
| StartPage | First page to print, 1-based and clamped to 1 |
| EndPage | Last page to print, clamped up to the last page |
| Copies | Number of copies, clamped to at least 1 |
| Collate | True collates the copies |
Return values
| 0 | No document is open, no printer could be resolved, or the job was not handed to the spooler |
|---|---|
| 1 | The job was handed to the print spooler |