pdfPrint3
Print the PDF file.
int pdfPrint3(PDFViewerHandle viewer, BOOL showDialog, int firstPage, int lastPage,
double llx, double lly, double urx, double ury,
double xScale, double yScale, double xOffset, double yOffset,
int rotate, int nCopies, char *printer)
This function is an extended version of
pdfPrint
. It prints the
currently open PDF file, with various options.
The arguments are:
showDialog
: If true,pdfPrint3
opens the standard print dialog, otherwise it prints to the default printer or to the printer specified in theprinter
argument.firstPage, lastPage
: The range of pages to print. IfshowDialog
is true, this will be used as the default page range in the dialog.llx, lly, urx, ury
: The lower-left (llx, lly
) and upper-right (urx, ury
) corners of the region of the page to be printed, measured in PDF coordinates. To specify a region, llx must be less than urx, and lly must be less than ury; otherwise, the whole page is printed. (Pass0, 0, -1, -1
to print the whole page.)xScale, yScale
: The horizontal and vertical scale factors, where 1.0 means actual size. If either value is less than or equal to zero, they are both ignored, and the page is printed actual size, or shrunk to fit the paper if necessary. (Pass-1, -1
to use the default scaling.)xOffset, yOffset
: The offset of the printed region from the lower-left corner of the page, measured in points (1 point = 1/72 inch). If either one is less than zero, the page is instead centered on the paper. (Pass-1, -1
to get the default behavior of centering the page.)rotate
: The rotation angle (0, 90, 180, or 270 degrees). If rotate is less than 0, the page will be printed at 0 or 90 degrees rotation (portrait or landscape), depending on its size relative to the paper size.nCopies
: If nCopies is greater than 0, it specifies the number of copies to be printed. Otherwise, the printer's default setting is used.printer
: The name of the printer to use, or NULL to use the default printer. IfshowDialog
is true, the printer argument is ignored.
pdfPrint3
returns pdfOk
if printing was
successful, otherwise an error code.
C:
/* this is equivalent to pdfPrint */
pdfPrint3(viewer, !silent, 1, viewer.numPages, 0, 0, -1, -1, -1, -1, _
-1, -1, -1, 0, NULL);