Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-12-01
8
Medium Priority
?
525 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

610 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