in reply to Problem using PNG images created by GD::Graphs in an API2 PDF doc

I don't pretend to know what is going on, but as I was bored, here are a couple of things that I did to your code, and I did end up with a functioning PDF:

Hope this helps!

Update: Versions I used (:

It also appears that the stringify is messing things up - either put the save before it or just remove it altogether as it serves no useful purpose (at least in this code fragment).

--
I'd like to be able to assign to an luser

Replies are listed 'Best First'.
Re: Re: Problem using PNG images created by GD::Graphs in an API2 PDF doc
by jmo0099 (Initiate) on May 12, 2004 at 17:49 UTC
    Thanks for taking the time to track down that info. For some odd reason this did not take care of the problem, I still get the same error. I am running the same package revisions as you are, with the only difference that I can see is that I am running Linux (RedHat 9) and you are running windows. Its hard (and scarey) to believe that this would make such a difference in the operation of these packages. Maybe I need to uninstall + re-install all packages to make sure that I have complete distributions. Thanks, John
Re: Re: Problem using PNG images created by GD::Graphs in an API2 PDF doc
by jmo0099 (Initiate) on May 10, 2004 at 23:18 UTC
    I tried your suggestions. What I did was:
        Added "$image->interlaced(undef);" in the line after I call the plot method.
        Added "$hPdf->save;" in the line after I called the stringify method.
        Changed the dimensions of the mediabox to be 1200x900.

    Unfortunately, after all this I am still having the same problem. When the PDF file is created it starts printing out "substr outside of string at /usr/lib/perl5/site_perl/5.8.3/PDF/API2/PDF/ImagePNG.pm line 137.".

    Do you know what versions of these packages you are running? Maybe there is some incompatability if I am on the bleeding edge of releases.

    Thanks for your help,
    John