[WinPrnDev] Re: Port monitors

  • From: "Christoph Lindemann" <Christoph.Lindemann@xxxxxxxxxxxxxxxxxxx>
  • To: <winprndev@xxxxxxxxxxxxx>
  • Date: Thu, 2 Sep 2010 14:29:41 +0200

Hi Adam,

 

1)       The port monitor does not know anything about the job content.
It only transports a stream of bytes.

2)       If you want to find out, from your port monitor, if duplex is
used, you need to parse the data stream. This data stream can be encoded
in one of many PDL (Page Description Language), depending on the driver.
This could be PCL, PostScript, Esc/P, Lavaflow, QPDL... in one of their
many incarnations and versions.

3)       The port monitor does not know anything about the source
application or the driver.

4)       If you want to change the options, you would need to parse the
job PDL and modify it or re-create/render the job using GDI.

5)       Depending on your needs, you could also look into:

a.       Creating a custom "print processor".

b.      Creating a custom "virtual printer", which would be the
interface between the user and your system

c.       Just buy one of the existing sollutions

 

Depending on the scope (supported OS versions, drivers, clustering...)
this is a major project, and "getting it right" requires massive
knowledge of Windows internals, spooler architecture, drivers... 

 

Have fun,

Christoph

 

________________________________

From: winprndev-bounce@xxxxxxxxxxxxx
[mailto:winprndev-bounce@xxxxxxxxxxxxx] On Behalf Of Adam Johnson
Sent: Thursday, September 02, 2010 1:39 PM
To: winprndev@xxxxxxxxxxxxx
Subject: [WinPrnDev] Re: Port monitors

 

Hi,

 

You are correct on point a, I would like to parse the print job to see
if duplex was selected. What is confusing me is how will the port
monitor know that duplex is selected or more importantly CAN it know?
surly the way duplex is selected ona n HP printer is different than
where its selected on a Xerox?

 

Or is it  that when one is selected the Port Monitor speaks directly to
windows so it doesn't matter what driver the job was spooled in?

 

My aim is to produce a port monitor that acts like an application, It
will parse the job and check its properties and if the properties are
not allowed change them. From Mono to colour and so on and so forth. I
know it cant be done because its spooled but what I can do is once the
job is spooled I will parse it using the port monitor and then if the
properties are not acceptable by a user's policy I will convert the PS
file to PDF and reprint it with the properties needed.

 

Also quick note it would be a good feature if i can police according to
job type so only print in Mono if its an email, can the port monitor
determine a print jobs original format? (.doc .pdf .html) and if not
then maybe the application the job was printed from ?

 

Regards

Adam

 

________________________________

Subject: [WinPrnDev] Re: Port monitors
Date: Thu, 2 Sep 2010 13:32:48 +0200
From: Christoph.Lindemann@xxxxxxxxxxxxxxxxxxx
To: winprndev@xxxxxxxxxxxxx

Hi Adam,

 

It is not clear to me if you want to "query" the >print job< or the
physical printer, or like this:

a)       parse the print job to see if duplex was selected/used

b)      query the physical printer, if there is a duplex unit present in
the printer

 

Could you please elaborate a little more on this? Also feel free to tell
us more, about what you are ultimately trying to accomplish, might be
you are trying to tackle this problem in the wrong way.

 

/christoph

 

________________________________

From: winprndev-bounce@xxxxxxxxxxxxx
[mailto:winprndev-bounce@xxxxxxxxxxxxx] On Behalf Of Adam Johnson
Sent: Thursday, September 02, 2010 1:17 PM
To: winprndev@xxxxxxxxxxxxx
Subject: [WinPrnDev] Port monitors

 

Hello Experts.

 

I am experimenting with writing my own print driver which will enable
users to print to. My question is with many strange and wonderful print
drivers around, can I write my own Port monitor that will parse and
interrogate information given to the print driver.

 

For example if I am using a Ricoh print driver and a user clicks
"File,Print" it comes up with the Ricog print dialog, so if a user
clicks color and duplex. Is there any way the port monitor can verify
this? or interrogate the PS file to get job properties?

 

If so then what about the other more complex information like Collate?
Number of pages on the X and Y direction? Resolution (DPI) ?  To the
even more specific information that is device dependent like is staples
on?

 

I am trying to set up a policy enforcement program on the print server
but would like all users to print to one common printer, my port monitor
will then interrogate the print job properties and check it against the
database?

 

Is that remotely possible?

 

Regards

Adam

Other related posts: