1

I need to apply some modifications (mostly replace some text a la s/foo/bar/) to everything that gets printed from a specific Windows application. My guess is that most of the building blocks that can be used for this are already available somewhere. My idea is to proceed as follows:

  1. A (fake) network printer is advertized (e.g. from a Linux host)
  2. Instead of printing, the communication (in PostScript, say) gets intercepted
  3. Things like compression get undone, the result is fed to ...
  4. ... a script I write that performs the needed text substitutions
  5. The resulting postscript is transmitted to the real printer

Is my idea feasible? And am I right that everything except step 4 should be available from basic tools? If so, could someone shed some lights on how I could really do this? I know too little about the internals of Windows/Linux network printing, CUPS and Samba and whatnot to feel confident how to proceed ...

6
  • If I understand it right, it would be common that the text would not be sent to the printer; the image of the text would be. So would you also want to use OCR??
    – BenjiWiebe
    Jun 30, 2014 at 13:51
  • @BenjiWiebe As far as I know PDLs, it is much more efficient to transfer a font description and then transmit the text content (which glyph of which font should be placed where) to the printer than to do the raster-image-processing on your computer and transmit the (resolution-dependant) image data to the printer. So, no, I assume I could get along withoput OCR. Jun 30, 2014 at 14:29
  • Oh, I see. OK. Do you not think it would be easiest to work on the client side? On the printing computer? Like all2pdf's virtual PDF printer...
    – BenjiWiebe
    Jun 30, 2014 at 17:22
  • @BenjiWiebe Hm, you mean print ot PDF, let my script manipulate the PDF, then print the modified PDF? Might be worth a thought (and a try) ... Jun 30, 2014 at 18:39
  • 1
    Hi, I have a similar issue. Were you successful? If so, how did you manage it?
    – spurra
    Mar 13, 2016 at 10:25

0

You must log in to answer this question.

Browse other questions tagged .