How can I insert text into an existing PDF using Ghostscript?
December 21, 2007 9:25 PM
Subscribe
How can I insert text into an existing PDF using Ghostscript?
I'm attempting to write a bash script that will take the output of the "tree" command, and insert it into an existing PDF template. The script works, bu I haven't been able to figure out how to take the output of it and stick it into this template. Does anyone know of a solution that does no use any additional software other than Ghostscript?
posted by jackofsaxons to computers & internet (3 comments total)
1 user marked this as a favorite
So start with a postscript template, insert your script output (which may need to be suitably massaged by inserting certain postscript commands as necessary), then send the resulting postscript to Ghostscript, which can turn it into a PDF.
You might be able to use something like groff? Working with groff is going to be much simpler yet than even messing with postscript. If your script could produce the text with needed groff formatting commands embedded, then you could send that output to groff to make PS, and the resulting PS output to Ghostscript to create a PDF.
Wiki for a bit more.
posted by flug at 10:21 PM on December 21, 2007