Facing issue while printing multipage documents using the BitMap driver

I am using the Bitmap driver to create the bitmap image. It is working fine but I just want to implement the feature to print multipage documents. I have implemented the OEMStartPage to accomplish this task but facing the issue and my driver getting crash.

sunil111193 wrote:

I am using the Bitmap driver to create the bitmap image. It is working fine but I just want to implement the feature to print multipage documents. I have implemented the OEMStartPage to accomplish this task but facing the issue and my driver getting crash.

And what did you expect us to do?  We don’t have your code, you haven’t
told us how you are trying to implement this, and you didn’t share a
single detail from the crash.  If you’re getting a crash, then you need
to debug the crash.

@Tim_Roberts said:
sunil111193 wrote:

I am using the Bitmap driver to create the bitmap image. It is working fine but I just want to implement the feature to print multipage documents. I have implemented the OEMStartPage to accomplish this task but facing the issue and my driver getting crash.

And what did you expect us to do? We don’t have your code, you haven’t
told us how you are trying to implement this, and you didn’t share a
single detail from the crash. If you’re getting a crash, then you need
to debug the crash.

Thanks, Tim for the reply, I am not getting a proper way to how I can print multipage documents (notepad, word doc … etc) using the bitmap driver. I want to create a bitmap image for each page.

sunil111193 wrote:

Thanks, Tim for the reply, I am not getting a proper way to how I can print multipage documents (notepad, word doc … etc) using the bitmap driver. I want to create a bitmap image for each page.

And do what with them?  You cannot convince the Windows printing
subsystem to create multiple spool files from a single job.  It simply
does not work that way.  That means you need to come up with a different
design.

What is going to happen to these files after you are create them?  Who
is the eventual consumer?  If you are able to write your files in TIFF
format, TIFF allows multiple pages in a single file.  That would let you
continue to use the spooling mechanism. But if you really insist that
you need straight, uncompressed BMPs, then YOU need to be creating the
files.  That puts you in complete control of where they go, how they are
named, and what they contain.  That’s a simple file creation problem
that does not require and special driver knowledge.

@Tim_Roberts said:
sunil111193 wrote:

Thanks, Tim for the reply, I am not getting a proper way to how I can print multipage documents (notepad, word doc … etc) using the bitmap driver. I want to create a bitmap image for each page.

And do what with them? You cannot convince the Windows printing
subsystem to create multiple spool files from a single job. It simply
does not work that way. That means you need to come up with a different
design.

What is going to happen to these files after you are create them? Who
is the eventual consumer? If you are able to write your files in TIFF
format, TIFF allows multiple pages in a single file. That would let you
continue to use the spooling mechanism. But if you really insist that
you need straight, uncompressed BMPs, then YOU need to be creating the
files. That puts you in complete control of where they go, how they are
named, and what they contain. That’s a simple file creation problem
that does not require and special driver knowledge.

When I am debugging the code then I found that OEMSendPage and OEMStartPage are invoking at each page. If I create the BMP image for each page then it is possible to send each BMP to the specified port (associated with the custom print monitor)?

@sunil111193 said:

@Tim_Roberts said:
sunil111193 wrote:

Thanks, Tim for the reply, I am not getting a proper way to how I can print multipage documents (notepad, word doc … etc) using the bitmap driver. I want to create a bitmap image for each page.

And do what with them? You cannot convince the Windows printing
subsystem to create multiple spool files from a single job. It simply
does not work that way. That means you need to come up with a different
design.

What is going to happen to these files after you are create them? Who
is the eventual consumer? If you are able to write your files in TIFF
format, TIFF allows multiple pages in a single file. That would let you
continue to use the spooling mechanism. But if you really insist that
you need straight, uncompressed BMPs, then YOU need to be creating the
files. That puts you in complete control of where they go, how they are
named, and what they contain. That’s a simple file creation problem
that does not require and special driver knowledge.

When I am debugging the code then I found that OEMSendPage and OEMStartPage are invoking at each page. If I create the BMP image for each page then it is possible to send each BMP to the specified port (associated with the custom print monitor)?

Tim, you have any idea how is the multipage functionality work on another standard printer like HP. Their firmware handles the multipage functionality or it handles by the drivers.

sunil111193 wrote:

Tim, you have any idea how is the multipage functionality work on another standard printer like HP. Their firmware handles the multipage functionality or it handles by the drivers.

The situation there is not comparable.  A multipage print job is sent to
the printer as one long, continuous data stream.  The “eject page”
command is just part of the PostScript or PCL data.

@Tim_Roberts said:
sunil111193 wrote:

Tim, you have any idea how is the multipage functionality work on another standard printer like HP. Their firmware handles the multipage functionality or it handles by the drivers.

The situation there is not comparable. A multipage print job is sent to
the printer as one long, continuous data stream. The “eject page”
command is just part of the PostScript or PCL data.

Thanks, Tim for your help. Tim, if I write the code to create the bitmap image for each page in Startpage (hook function) then there is any way to send each BMP image to a port monitor.

sunil111193 wrote:

Thanks, Tim for your help. Tim, if I write the code to create the bitmap image for each page in Startpage (hook function) then there is any way to send each BMP image to a port monitor.

Again, that’s not the question you need to ask.  You can send data to
the port monitor any time you want by using DrvWriteSpoolBuf…  The
question you need to ask is whether you can fool the port monitor into
creating multiple physical files for a single job.  I don’t think you
can.  You either need to create your files within the bitmap driver, or
write a custom port monitor that scans the incoming stream for
BITMAPFILEHEADER structures and directs them to separate files.