Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by Albannach (Prior)
on May 10, 2004 at 14:22 UTC ( #352060=note: print w/ replies, xml ) Need Help??


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:

  • use non-interlaced PNG with $image->interlaced(undef); in the PNG sub
  • throw in a $hPdf->save; at the end of the PDF sub
  • make sure your media box is large enough (at least 800x600 in your case)

Hope this helps!

Update: Versions I used (:

  • Perl 5.8.3 as ActiveState build 809 on Win2k
  • GD::Graph::bars 1.25
  • PDF::API2 0.3r77

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


Comment on Re: Problem using PNG images created by GD::Graphs in an API2 PDF doc
Select or Download Code
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
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://352060]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-09-16 04:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (156 votes), past polls