[Chicago-talk] Editing, altering, manipulating PDFs

Jay Strauss me at heyjay.com
Fri Mar 30 13:52:54 PDT 2007


On 3/30/07, Jay Strauss <me at heyjay.com> wrote:
> On 3/27/07, Elias Lutfallah <eli at mortgagefolder.com> wrote:
> > Yeah, the docs are pretty bad. Also, I should have sent you to PDF::API2,
> > not Lite. Near as I can tell, Lite is just for creating PDF from scratch,
> > not modifying existing ones.
> >
> > The real meat of the docs for PDF::API2 is in PDF::API2::Content and
> > PDF::API2::Page.
> >
> > Here's a bump, to get you past the grueling docs:
> >...
> > Elias Lutfallah
> > Chief Technology Officer
> > Mortgage Desk, Inc.
>
> How would I find out the methods for the $gfx->image or  $pdf->image_gif?
>
> For example, I'd like to shrink my signature image.
>
> Just guessing, I tried $gfx->image($image_file, 50, 50, 100); which
> works but it changes from a rectangular image to a square one.  I need
> to shrink the image to a specific width while keeping the same aspect
> ratio.
>
> Thanks
> Jay
>

I stumbled upon:
my $aspect_ratio = $image_file->height()/$image_file->width();

my $width = 100;
# plot the image at 50,700
$gfx->image($image_file, 150, 30, $width, $width*$aspect_ratio);

But that was just luck.  I know the docs suck, but this is really tough

Jay


More information about the Chicago-talk mailing list