Print Queue for Bitmap Printer Driver printing to File (Local Port)

How to get Printer Queue working for Bitmap Printer driver which is directly printing to a File (LOCAL PORT).
when I print next time it goes for Replacement of the previous Image.
I need it has to wait in print queue while the last image was removed by other application.
Is there any way to do so?

sunil111193 wrote:

How to get Printer Queue working for Bitmap Printer driver which is directly printing to a File (LOCAL PORT).

when I print next time it goes for Replacement of the previous Image.

I need it has to wait in print queue while the last image was removed by other application.

Is there any way to do so?

Are you saying your printer driver writes its results to a file, but it
always uses the same file name, so the next job overwrites the first one?

That’s a design defect in your driver.  The right answer is to fix your
driver so that it creates, for example, “print-job-001.bmp” and
“print-job-002.bmp”, etc.

Thanks your suggestion is appreciated…

My requirement is next printing should wait and can be canceled from the queue if already an image file is present.
I don’t want to show print success by giving a new name to the next image.

example, “print-job-001.bmp” and “print-job-002.bmp”, etc.

This will give success for both print and 2 files will be there. I don’t want this.

I want next print should wait in queue if there is any image is already present. that image will be used in another process.
Is there any way to do so?

sunil111193 wrote:

I don’t want to show print success by giving a new name to the next image.

This will give success for both print and 2 files will be there. I don’t want this.

Why not?  It’s a far better design.  And it’s a trivial modification to
your user-mode monitoring app to handle the multiple output files.

I want next print should wait in queue if there is any image is already present. that image will be used in another process.

Is there any way to do so?

What have you tried?  The most obvious solution would be to add a simple
loop to the driver just before you open the file that says

    while( PathFileExists( “my_image.bmp” ) )
    {
        Sleep( 1000 );
    }

Thanks for your suggestions, it works for me.

I am able to build and run “Sample print monitor driver” given in WDK sample.
As I am able to install it by going to “Add new port type” inside “Ports” Tab of “printer properties” and giving the path of monitor.inf

Now I am stuck in how to install it using commands from CMD.

A ‘print monitor driver’ using commands for a ‘new port type’ add into the list of “Available Port Type”