There
are several pitfalls to Automatically
Printing documents from MS Office by
using the RTK BiAutoPrint.dll of the
printer driver.
If you use the Black Ice BiAutoPrint
dynamic link library or ActiveX control,
you can print documents
programmatically. The BiAutoPrint can
handle several file formats, for example
doc, xls, pps, pdf, html, txt, rtf, etc.
You can add the BiAutoPrint module to
your project easily and you can print
documents without user interaction, so
you can implement batch printing
applications.
The BiAutoPrint uses third party
applications for printing documents, for
example if you want to print a file with
the doc extension, the BiAutoPrint will
print the document with Microsoft |
Word.
If you want to print PDF files, the
BiAutoPrint starts Adobe Acrobat Reader
for printing.
Because the BiAutoPrint starts another
application, the
application should be closed after
printing. The BiAutoPrint contains a BIAPEndPrinting
method for closing the printing
application. You should call this
method, when the printing is finished.
When the Black Ice printer sends the
BLACKICE_MESSAGE_ENDDOC message, the
BIAPEndPrinting method call won’t close
the printing application, because the
printing didn’t finish yet completely.
|
The
BiAutoPrint sample contains a method for
checking the spooler of the printer. If
the specified job is removed from the
spooler, or the spooler is getting
empty, you can call the BIAPEndPrinting
method to close the printing
application. In this case the printing
application (for example Microsoft Word)
can be closed correctly.
The following code snippets show you how
to get the count of the jobs in the
spooler:
|