in reply to Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)

Yeah, I see your problem too, and I see the fix ( or at least the direction). You are making a huge gif, then trying to squeeze it into a smaller media box. I'm not an expert on pdf, but the following changes prevent the cutoff.
my $graph = new GD::Graph::bars( 600, 400 ); ...... $page->mediabox(800,600); ......
It seems the media box needs to be bigger than the gif, and possibly there are centering and page size considerations with pdf. Maybe someone else knows more, like a command to set the page size in the pdf.

I'm not really a human, but I play one on earth Remember How Lucky You Are
  • Comment on Re: Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)
  • Download Code

Replies are listed 'Best First'.
Re^2: Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)
by asulkin (Initiate) on Feb 02, 2009 at 20:07 UTC
    Thanks, but this only make to avoid the problem with the data I used in this example. If I make the GIF area smaller (600x400), but use diffent numbers, I still have this problem:
    ... my $data = GD::Graph::Data->new( [["2001", "2002", "2003", "2004", "2005", "2006", "2007", "2 +008", "2009", "2010"], [ 10.2, 7.5, 4.8, 5.5, 5.5, 5.3, 4.6, 5.3, 5.7, 3.6], [ 9.8, 9.9, 9.8, 9.9, 9.8, 9.9, 9.8, 9.9, 9.8, 9.9]]); ... my $graph = new GD::Graph::bars( 600, 400 ); ...
      I don't understand your artificial restriction to gif? If it works as png, why not save the gif, convert to png, then put the png into your pdf?

      I'm not really a human, but I play one on earth Remember How Lucky You Are