Advertise here: Contact FM.


How can I insert text into an existing PDF using Ghostscript?
December 21, 2007 9:25 PM   RSS feed for this thread 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
As a thought, postscript is usually easier to work with than PDF.

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


Even better, could you make the PDF template with latex?
posted by devilsbrigade at 10:54 PM on December 21, 2007


Perhaps pdftk will help. I googled for pdftk insert text into pdf and found this this, where they use pdftk to insert data into a pdf form.
posted by donut at 3:26 AM on December 22, 2007


« Older Can anyone recommend a good ma...   |   Need funny, easy-to-finish boo... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Pushing the limits of PDFs. First, what are they? September 27, 2008
PDF Manipulation utility for unix? August 11, 2008
Will Firefox 3.0 finally allow inline viewing of... June 17, 2008
My computer is a .pdf’ing mess! February 7, 2008
.chm to .pdf conversion in Mac OS X? September 23, 2007