Add pages to a print job.
int pdfPrintToJob(PDFViewerHandle viewer, int firstPage, int lastPage, double llx, double lly, double urx, double ury, double xScale, double yScale, double xOffset, double yOffset, int rotate)
This function adds page(s) to the current print job (which was started by a call to
pdfStartPrintJob). You can load a different PDF file before each
pdfPrintToJobcall, and/or change the parameters passed to each
The arguments are:
firstPage, lastPage: The range of pages to print. If
showDialogis 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. (Pass
0, 0, -1, -1to 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, -1to 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, -1to 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.
/* start the print job, setting parameters that apply to the whole job */ pdfStartPrintJob(viewer, FALSE, 1, "printer55"); /* set parameters that apply to the next part of the print job */ pdfLoadFile(viewer, "file1.pdf"); pdfPrintToJob(viewer, 1, 3, 0, 0, -1, -1, -1, -1, -1, -1, -1); /* set parameters for the next part of the print job */ pdfLoadFile(viewer, "file2.pdf"); pdfPrintToJob(viewer, 1, 3, 0, 0, -1, -1, -1, -1, -1, -1, 90); ... /* finish the print job */ pdfFinishJob(viewer);