BiPlugin Output Directory Sample
Version number:

BuyBuy Now DownloadDownload

Sometimes it is necessary for the plugin dll to receive information from a standalone application before changing a setting. This example shows how the plugin DLL can communicate with a running c# application to change the printer driver output directory. Applications changing other parameters such as pdf passwords, can be easily made by rewriteing this sample or please contact the BlackIce technical support for readily available solutions.

This demonstration sample program will set the custom file name to IMG <>printedby <>.<>and indicate whether this template is valid or not. The sample can be compiled using Visual Studio 2005 using the appropriate project file.

How It Works:

This sample consists of two projects. A customized BiPlugin.dll (BiPlugin_OutputDir) and a simple c# application (PlugInSample_OutputDir).

  • The Printer drivers starts the C# application and calls the BiStartDoc() function of the BiPlugin.dll; Enable Start Application in Printer Driver Printing Preferences, select the compiled C# Sample and set the printer driver to start the application before printing.

  • After getting the new output directory from the user. the c# application creates an event named “Global\\BIPLUGINSTARTED”, and waits for the BiPlugin.dll to notice and acknowledge it by setting the event object to a signaled state.

  • The application now sends the new output directory using the SendPipeMessage() function of the BiPlugin.dll, at the same time, the BiPlugin dll receives the data using the ReadOutputDirFromPIPE() function.

  • The plugin sets the output directory in the DEVMODE structure and the BiStartDoc() function returns with a TRUE value.

To read more about this sample, please visit the Online Manual of the Resource Toolkit.


Back to Sample Comparison Chart page