in reply to Editing/Replacing Text in a PDF
In general, it is also possible that the PDF contains compressed text.
You also forgot binmode on the OUT file handle.
The crude way to do what you want is to convert the PDF to Postscript, substitute the text, and convert it back. I use the ImageMagick program 'convert' to do this.
There are also perl modules available to wrap the ImageMagick functionality. I believe that ImageMagick is in turn calling Ghostscript to handle the conversion, so you could use that directly, instead.`convert Build3.pdf Build3.ps` ... Postscript filtering code goes here ... `convert Build3.ps out.pdf`
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Editing/Replacing Text in a PDF
by ikkon (Monk) on Dec 20, 2006 at 16:26 UTC |