Solved

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

Posted on 2003-12-01
8
515 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

705 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