constantin.iliescu has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks!

I have a problem trying to add a image on a PDF page using PDF::API2::Simple. This didn't appear when using the same libraries on Perl 8.08. Whenever I try to add the image as wide as the PDF page, a white vertical line appears on the right of the image.

# image path my $imageHeaderPath = '/path/to/image/image.jpg'; # insert image $pdf->image ( $imageHeaderPath, width => 612, height => 50, x => 0, y => $pdf->y );

Update: it seems that the problem isn't with images only, but with all the page's content. The white line appears over text or any graphics.

Also, the second image must be a png.

Please help.

Thank you.

Replies are listed 'Best First'.
Re: Perl 8.10 PDF::API2::Simple problem (Perl versions)
by moritz (Cardinal) on Sep 10, 2009 at 06:43 UTC

    You seem to be quite confused about Perl versions.

    Versions I know of include

    • 5.8.8, also written as 5.008008
    • 5.8.9, also written as 5.008009
    • 5.10.0, also written as 5.010000
    • 5.10.1, also written as 5.010001

    I can't make any sense of the "Perl 8.10" you use in the title - which one do you actually mean? What does perl -v say?

    Perl 6 - links to (nearly) everything that is Perl 6.

      Hi, moritz!

      Sorry, you are right. The script worked on Perl v5.8.4 built for i686-linux-thread-multi, and it causes problems on Perl v5.10.0 built for i686-linux-thread-multi-64int.

        I'd suspect it's rather the module version (not the Perl version) that's responsible for the different behavior. So, to narrow down on the issue, it would be interesting to know what module versions you're using.  In case you still have both versions available, you could check (for both 5.8.4 and 5.10.0 — make sure you call the correct perl binary, if they're installed on the same machine):

        perl -MPDF::API2 -le 'print $PDF::API2::Version::VERSION' + (yes, Version::VERSION) perl -MPDF::API2::Simple -le 'print $PDF::API2::Simple::VERSION'

        As PDF::API2 is a pure-Perl module, you should be able to run either version of the module with either version of Perl without recompiling anything  (in case it should turn out that you have different module versions...)