Solved

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

Posted on 2003-12-01
8
511 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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