Solved

Need to spool printer output and have it redirected to another program's stdin for manipulation

Posted on 2003-12-01
8
507 Views
Last Modified: 2013-12-03
We have a Unix-based accounting system that we use, and part of our ability is to spool the output of a printer operation and have it piped to another program.  We have scripts that take this output from stdin, manipulate it, and then print it to a printer of our choice.  We essentially have full control of our printing operations.

I need to create the analog for Windows (NT 4.0, 2K, ...).  I have made use of RedMon, and although it's proven useful in spooling the printer output and piping it to my program, it still makes use of a printer driver.  The problem with this is that I can't find a printer driver that does NOT adulterate the output; indeed, even the Generic Text driver likes to add the filename of that which was printed on the header, and the page numbers on the footer.

So, to recap: I need to have a printer operation's stdout pipe to the stdin of my program.  My program will then print to the necessary printer.  Is anyone aware of any truly Generic Text driver that doesn't modify the data sent to the printer in any way?  Any other suggestions are GREATLY appreciated!
0
Comment
Question by:BitTwiddler
  • 3
  • 2
8 Comments
 
LVL 10

Expert Comment

by:ADSaunders
ID: 9851103
Hi BitTwiddler,
This is what you need: http://www.cs.wisc.edu/~ghost/redmon/

Regards .. Alan
0
 

Author Comment

by:BitTwiddler
ID: 9851150
Thanks Alan.  I noted in my question that I've used RedMon, and it gets me *almost* where I need to be.  The trouble is with the fact that RedMon still wants a printer driver to be associated with any printer that uses the redirected port created by RedMon.  The Generic Text driver still modifies the data, so by the time my program receives it extra data has been added.

Worst-case scenario, I would use regular expressions to remove the junk that the Generic Text driver adds, but I'd really like a "raw" text driver that simply doesn't modify the data.  I'm also open to other ideas.

Thanks for the reply!
0
 
LVL 10

Expert Comment

by:ADSaunders
ID: 9851184
I had this problem some while ago (previous employment) I did it by linking redmon through another driver that did little but select the printer and font, and pass on the incoming text. b****red if I can remember what it was called though.
I'll see if I can drag up any more info.
0
 

Author Comment

by:BitTwiddler
ID: 9851936
I'll up the points in hope of more interest :)
0
 
LVL 10

Accepted Solution

by:
ADSaunders earned 500 total points
ID: 9852429
Hi,
I found it! Don't know whether it'll solve your problem however. At the time (April 1999) we had a problem with *Nix style software on a WinNT network. Like you, we needed to print a plain text stream, but managers had bought cheaper Windows Only printers. (i.e. no firmware printing engine, had to be driven through Windows) The following is the solution I came up with, and posted (I think) in the HP Support forum at the time.
-------  SNIP ------------

At Last! a solution to Print Performance Architecture (at least sufficient unto my needs).
The problem is that DOS, and legacy programs send output to a port rather than a print driver, and that PPA printers (including the HPDJ720 and HPDJ820) need to be driven from their Windows print driver.

The first partial solution exists in a program called Printfile (prfile.exe or prfile32.exe) available from http://hem1.passagen.se/ptlerup. (Now http://www.lerup.com/)
This program (which can both be run from a DOS prompt, and can print data sent on standard input) can maintain named parameter settings defining printer font layout etc (including n-up layouts), and will invoke the defined printer driver upon execution.

The second part is a port redirection monitor available from http://www.cs.wisc.edu/~ghost/redmon/index.html. This allows the creation of a 'printer' port where all data received on that port can be filtered through another program .. In this case prfile32!

The third part is mainly cosmetic, a desktray utility to quickly change the default printer.
The (free) one I use is available from {{ broken link removed -- DR / EE PE }}

Probably the most important aspect of this solution, is that all programs are actually free. Redmon is issued under the GNU public license, printfile and PrtChg are both issued as freeware by the authors.

Hope this is of some use

.. Alan
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now