How to capture any report into an image of desired format?

I am developing a Virtual printer driver… i have created a dummy printer driver… Now it has to work for capturing any document(which i select it and click print) as an image(of desired format) … I know doing it through wizard as per given in GHOST SCRIPT tool… but how to do it programatically using C… Because i am developing it as a software…

xxxxx@gmail.com wrote:

I am developing a Virtual printer driver… i have created a dummy printer driver… Now it has to work for capturing any document(which i select it and click print) as an image(of desired format) … I know doing it through wizard as per given in GHOST SCRIPT tool… but how to do it programatically using C… Because i am developing it as a software…

How to do WHAT programmatically? If you are writing an application, and
you want to print directly to a specific printer, you can do that by
passing the printer name to CreateDC. There are samples on the web.

However, you can’t force other applications to do that.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim, I want to print a word document as an image(Virtual printer concept)… Now i have created a dummy printer driver… If i select that printer and click print, it will do nothing until now… What i wanted to know is, in what format it will be printed as image… Definitely it will be converted into a RAW or EMF or BINARY or ASCII or any other format… Also, i want to see these contents… their format… (Actually i want to view the file)… Please help me in knowing this…

xxxxx@gmail.com wrote:

Tim, I want to print a word document as an image(Virtual printer concept)… Now i have created a dummy printer driver… If i select that printer and click print, it will do nothing until now… What i wanted to know is, in what format it will be printed as image… Definitely it will be converted into a RAW or EMF or BINARY or ASCII or any other format… Also, i want to see these contents… their format… (Actually i want to view the file)… Please help me in knowing this…

Well, you have to remember that it is YOUR DRIVER that will be doing
this conversion. It’s not like you will be handed a complete image of
the page. Instead, your driver is going to get individual GDI driver
calls (like DrvTextOut, DrvBitBlt, DrvStrokePath, etc.) that the
application is using to construct the image on the printed page, line by
line, word by word, sometimes character by character. From those
requests, you have to write code to create whatever image format you
want. Now, you can let GDI do most of the drawing into a DIB surface.
Then, in the end-of-page handler, you will have a DIB that you can
convert to whatever image format you want.

What is it, exactly, that you are trying to do? Perhaps a print monitor
or print provider would be an easier path. Again, the DDK samples are
going to be your best friend, but it will take time to study them.

If all you want is the text, the “tty” sample is the same as the
in-the-box Generic Text Only printer driver.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim… My doubt is whether all the examples given in src\print folder of DDK(cpcuisam, genprint, mini, monitor, tty, etc.) are needed to develop a printer driver that accomplishes my task or each one is a separate example…