Custom Plug In Support Version number:
Add a Custom Plug-in to the Black Ice Printer Drivers!
The Black Ice printer drivers include Custom Plug-In support which is accessed through a dynamic linked library or DLL, and is loaded by the printed driver during printing. The printer driver calls pre-defined functions from the Plug-in at each phase of printing, and will not continue printing until the function returns. Developers will have full access to the DLL and can insert their own custom code to each DLL function to perform a variety of tasks as required by their application.
The Black Ice printer drivers can convert any file printed from any Windows application into an image or PDF file, which can then be faxed, archived, etc. as necessary. Print Jobs can be submitted to the Black Ice printer drivers from either custom applications or from typical applications, such as Notepad or Microsoft Office applications. When using custom applications, developers can modify their printing application to perform exactly as they require, however when printing from a third party application, developer’s are at the mercy of the application vendor and the printing user. Until now…
How It Works
The Black Ice printer driver will load the Plug-In DLL with each print job and will pass to each DLL function a pointer to the devmode of the current print job. When the print job starts, at the Start Document phase, the Plug-In DLL can pass custom data to the printer driver. The custom data will be stored by the driver for the duration of the print job. The size of the custom data is not limited by the printer driver, however using a large data block is not recommended since the printing can be negatively impacted. Specifying a data block of no larger than 10-20 KB should be sufficient in most cases and will not have an impact on performance. The printer driver will return a pointer to the custom data in each additional function call to the Plug-in DLL. The Plug-in DLL can then modify or use the custom data in any way desired.
Plug-in DLL functions:
The BiStartDoc() function will be called once for each print job, when the printer driver starts generating the images. The printer driver will pass the DEVMODE to the function and will allocate memory for the custom data passed back by the function.
The BiEndDoc() function is called one for each print job when the printer driver each time the printer driver finishes processing a document. The printer driver will pass the DEVMODE, the custom data and the name of the group file. After the function returns the memory allocated for the custom data will be de-allocated.
Some Possible Uses
- Print Job Authorization – prompt for a username, password, etc. from the BiStartDoc function
- Display a custom database window for archiving applications – prompt for a database name, JobID, etc. from the BiStartDoc function
- Change printer driver settings on the fly (output directory, filename, etc)
- Alternate form of message handling - the printer driver will call a function of the DLL for each printing event which can be used to notify a developer’s application of the current printing status.