Start a print job.
int pdfPrintStartJob(PDFHandle jobControlPDF)
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 XpdfPrint's print job API. It requires a few additional steps (compared to pdfPrint4), but is more flexible.

The pdfPrintStartJob function starts a print job. The following function calls must be done before calling pdfPrintStartJob (and any changes to these parameters made after calling pdfPrintStartJob will be ignored):

After calling pdfPrintStartJob, you can use pdfPrintToJob to add pages to the print job. Finally, use pdfPrintFinishJob to complete the print job.

IMPORTANT: One PDFHandle is used to store all of the printing parameters, both the job-wide parameters (as described above) and the per-file parameters (see pdfPrintToJob). This "job-control" handle must remain open until after pdfPrintFinishJob is called. Typically, the first PDF file in the job is used as the job-control handle, but it can be any PDF file (even one which isn't printed as part of the job). The handles for other PDF files printed in the job can be closed after pdfPrintToJob is called.

PDFHandle jobControlPDF, pdf2, pdf3; /* open the first PDF file, which is also used as the job-control handle */ pdfLoadFile(&jobControlPDF, "c:\\first.pdf"); /* set parameters that apply to the whole job */ pdfPrintSetPrinter(jobControlPDF, L"printer55"); /* start the print job, using the parameters set above */ pdfPrintStartJob(jobControlPDF); /* set parameters that apply to the first PDF file */ pdfPrintSetPages(jobControlPDF, "3-4"); /* add the first PDF file (which is also the job-control handle) to the job */ pdfPrintToJob(jobControlPDF, jobControlPDF); /* WARNING: do not close jobControlPDF yet */ /* load the second PDF file */ pdfLoadFile(&pdf2, "c:\\second.pdf"); /* set parameters that apply to the second PDF file */ pdfPrintSetPages(jobControlPDF, "1-10"); /* add the second PDF file to the job */ pdfPrintToJob(jobControlPDF, pdf2); /* the second PDF file can be closed here */ pdfFree(pdf2); /* third PDF file is similar to the second */ pdfPrintSetPages(jobControlPDF, "2"); pdfLoadFile(&pdf3, "c:\\third.pdf"); pdfPrintToJob(jobControlPDF, pdf3); pdfFree(pdf3); /* finish the print job */ pdfPrintFinishJob(jobControlPDF); /* the job-control handle can now be closed */ pdfFree(jobControlPDF);