pdfStartPrintJob
Start a print job.
int pdfStartPrintJob(PDFViewerHandle viewer, BOOL showDialog,
int nCopies, char *printer)
If you need to modify parameters for different pages within a print
job, or if you need to combine pages from multiple PDF files into a
single print job, you can use the print job API. It requires a few
additional steps (compared to
pdfPrint3
), but is more flexible.
This function starts a print job. 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.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.
pdfStartPrintJob
call should be followed by one or
more calls to pdfPrintToJob
and finally a call to
pdfFinishPrintJob
.
C:
/* 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);