startPrintJob
Start a print job.
startPrintJob([in] VARIANT_BOOL showDialog, [in] int nCopies, [in] BSTR 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
print3
), but is more flexible.
This function starts a print job. The arguments are:
showDialog
: If true,print3
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 the empty string ("") to use the default printer. IfshowDialog
is true, the printer argument is ignored.
startPrintJob
call should be followed by one or more
calls to printToJob
and finally a call to finishPrintJob
.
VB:
' start the print job, setting parameters that apply to
' the whole job
viewer.startPrintJob(False, 1, "LaserJet")
' set parameters that apply to the next part of the print job
viewer.loadFile("file1.pdf")
viewer.printToJob(1, 3, 0, 0, -1, -1, -1, -1, -1, -1, -1)
' set parameters for the next part of the print job
viewer.loadFile("file2.pdf")
viewer.printToJob(1, 3, 0, 0, -1, -1, -1, -1, -1, -1, 90)
...
' finish the print job
viewer.finishJob()