friedo has asked for the wisdom of the Perl Monks concerning the following question:
I am using Image::Magick to annotate some PDFs.
use strict; use warnings; use Image::Magick; my $pdf = Image::Magick->new; $pdf->Read("foo.pdf"); $pdf->Annotate( font => 'Times', pointsize => 12, fill => 'red', text => "Wahoo!", undercolor => 'white', x => 40, y => 20 ); $pdf->Write("bar.pdf");
This works fine, and places a nice red "Wahoo!" in the upper left corner of my PDFs. The problem is that ImageMagick seems rasterize the entire PDF in order to do this, and the resulting PDF is of very poor resolution. I can fix this by calling $pdf->Resample, but the main problem is that the rasterized PDF loses all of its text data, making it impossible to search in or edit. So I need a way to add text to PDFs quickly, but preserve the text data (and preferably not murder the resolution.)
Thanks!
friedo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Better way to add text to PDFs?
by holli (Abbot) on Jul 14, 2005 at 16:38 UTC | |
|
Re: Better way to add text to PDFs?
by shiza (Hermit) on Jul 14, 2005 at 16:33 UTC | |
|
Re: Better way to add text to PDFs?
by merlyn (Sage) on Jul 14, 2005 at 16:36 UTC | |
by friedo (Prior) on Jul 14, 2005 at 17:19 UTC | |
|
Re: Better way to add text to PDFs?
by traveler (Parson) on Jul 14, 2005 at 19:31 UTC | |
by friedo (Prior) on Jul 14, 2005 at 20:08 UTC | |
by BigLug (Chaplain) on Jul 14, 2005 at 23:16 UTC | |
by friedo (Prior) on Jul 15, 2005 at 18:12 UTC | |
by BigLug (Chaplain) on Feb 13, 2007 at 13:59 UTC | |
|
Re: Better way to add text to PDFs?
by TheStudent (Scribe) on Jul 14, 2005 at 19:13 UTC |