Sample for sending Printer data to file.

Hello Everybody
I want to write all print data sent to the printer to a file(any readable
format) also. I’m new to printer drivers, So Please anyone tell me which DDK
sample is best to start with, I searched the archives and found that
‘oemuni’ or may be ‘genprint’ can be used for this or do I need to write a
Print processor for this?, Is my assumption fine or should I use some other
sample.
I want only text to be printed in file and images are not necessary.

Thanks.
Regards,
Anuj Agarwal

Anuj Agarwal wrote:

Hello Everybody
I want to write all print data sent to the printer to a file(any
readable format) also. I’m new to printer drivers, So Please anyone
tell me which DDK sample is best to start with, I searched the
archives and found that ‘oemuni’ or may be ‘genprint’ can be used for
this or do I need to write a Print processor for this?, Is my
assumption fine or should I use some other sample.
I want only text to be printed in file and images are not necessary.

How much control do you have over the user? If you can force them to
use a different printer driver, then the “Generic/Text Only” driver will
do this. If you have to intercept data sent to an arbitrary printer,
then you can’t do it this way. Remember that printers do not
(generally) come with TrueType fonts installed. When you draw “word” in
Arial Bold 14-point on a printer DC, the printer never sees the string
“word”. What it sees is a graphics bitmap that happens to represent
that text in that specific font.


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

I’m joining to Anuj’s question: What is the solution if i can’t force the
user to choose a specific printer? (Or maybe there is a way to forward each
print to “my printer” in order to produce a readable format and then to the
user’s printer?)

Thanks.

On 5/15/06, Tim Roberts wrote:
>
> Anuj Agarwal wrote:
>
> > Hello Everybody
> > I want to write all print data sent to the printer to a file(any
> > readable format) also. I’m new to printer drivers, So Please anyone
> > tell me which DDK sample is best to start with, I searched the
> > archives and found that ‘oemuni’ or may be ‘genprint’ can be used for
> > this or do I need to write a Print processor for this?, Is my
> > assumption fine or should I use some other sample.
> > I want only text to be printed in file and images are not necessary.
>
>
> How much control do you have over the user? If you can force them to
> use a different printer driver, then the “Generic/Text Only” driver will
> do this. If you have to intercept data sent to an arbitrary printer,
> then you can’t do it this way. Remember that printers do not
> (generally) come with TrueType fonts installed. When you draw “word” in
> Arial Bold 14-point on a printer DC, the printer never sees the string
> “word”. What it sees is a graphics bitmap that happens to represent
> that text in that specific font.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Hello Tim
For my case there will be only 1 printer connected in the Network and my
driver will also be loaded on that system only and now I have to write all
the print data coming to that printer in a file and no matter whether its
written in plain text or using some ‘Fonts’ or in "Bold’, for me, I have to
treat it as a text, So for this do I need to use ‘oemui’ sample or can it be
done by ‘Generic/Text’ only.
Thanks.
Regards,
Anuj Agarwal

On 5/15/06, Tim Roberts wrote:
>
> Anuj Agarwal wrote:
>
> > Hello Everybody
> > I want to write all print data sent to the printer to a file(any
> > readable format) also. I’m new to printer drivers, So Please anyone
> > tell me which DDK sample is best to start with, I searched the
> > archives and found that ‘oemuni’ or may be ‘genprint’ can be used for
> > this or do I need to write a Print processor for this?, Is my
> > assumption fine or should I use some other sample.
> > I want only text to be printed in file and images are not necessary.
>
>
> How much control do you have over the user? If you can force them to
> use a different printer driver, then the “Generic/Text Only” driver will
> do this. If you have to intercept data sent to an arbitrary printer,
> then you can’t do it this way. Remember that printers do not
> (generally) come with TrueType fonts installed. When you draw “word” in
> Arial Bold 14-point on a printer DC, the printer never sees the string
> “word”. What it sees is a graphics bitmap that happens to represent
> that text in that specific font.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Anuj Agarwal wrote:

For my case there will be only 1 printer connected in the Network and
my driver will also be loaded on that system only and now I have to
write all the print data coming to that printer in a file and no
matter whether its written in plain text or using some ‘Fonts’ or in
"Bold’, for me, I have to treat it as a text, So for this do I need to
use ‘oemui’ sample or can it be done by ‘Generic/Text’ only.

If you need the job to print normally on that printer as well, then
clearly you cannot replace the printer driver. “Oemui” isn’t going to
help you, either; all it does is allow you to add another property page
to the print dialog user interface.

You may be able to tap into the raw data stream by writing a language
monitor. However, it’s going to be in the printer’s native format, not
plain text. I don’t know of any way to do that, short of writing a
“wrapper” driver to intercept all of the GDI calls into the driver.
That’s a lot of work.


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

So tell me how to start with and according to you, Language monitor
too wont work so wat could be the possible way, now I’m totally stuck
on this. Please help!

Regards,
Anuj Agarwal

On 5/16/06, Tim Roberts wrote:
> Anuj Agarwal wrote:
>
> >
> > For my case there will be only 1 printer connected in the Network and
> > my driver will also be loaded on that system only and now I have to
> > write all the print data coming to that printer in a file and no
> > matter whether its written in plain text or using some ‘Fonts’ or in
> > "Bold’, for me, I have to treat it as a text, So for this do I need to
> > use ‘oemui’ sample or can it be done by ‘Generic/Text’ only.
>
>
> If you need the job to print normally on that printer as well, then
> clearly you cannot replace the printer driver. “Oemui” isn’t going to
> help you, either; all it does is allow you to add another property page
> to the print dialog user interface.
>
> You may be able to tap into the raw data stream by writing a language
> monitor. However, it’s going to be in the printer’s native format, not
> plain text. I don’t know of any way to do that, short of writing a
> “wrapper” driver to intercept all of the GDI calls into the driver.
> That’s a lot of work.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>