Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://352060]
help
Chatterbox?
[Corion]: marto: Yeah - their mother picked all three of them up at the kindergarden to then go to the hospital, and all three of them were well behaved, and all also were quite obedient when they came home, so they recognized the situation
[Corion]: Nice to see that the kids have some understanding of important things that happen and the appropriate behaviour :)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2016-12-08 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (137 votes). Check out past polls.