Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

Is anyone out there using PDF::API2 with ActiveState 5.6? I'm trying to use the module to place some graphics in a PDF file and it keeps bombing even before I've coded anything to access it!

I've got the following code thusfar:

#!/usr/bin/perl -w use strict; use LWP; use HTTP::Request::Common; use PDF::API2; use Image::Info; use File::Spec; my $queryString; my @queryString; print "Content-type: text/html\n\n"; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $queryString, $ENV{'CONTENT_LENGTH'}); @queryString=split(/&/,$queryString); print @queryString; }

and I'm getting the following error message when I try to test run it:

Use of uninitialized value in sprintf at C:/Perl/site/lib/PDF/API2/PDF/Dict.pm line 17.

Has anyone else run in to this problem? If so, how did you cure it?

There is no emoticon for what I'm feeling now.

Replies are listed 'Best First'.
Re: Problems using PDF::API2
by JaWi (Hermit) on Jan 23, 2003 at 09:43 UTC
    A quick glance at the code of PDF::API2::PDF::Dict reveiled the following snippet:
    my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMP} || $ENV{TEMP}; $tempbase = sprintf("%s/%d-%d-0000", $temp_dir, $$, time());
    Since you're trying to use it under a Windows machine, you should either set the environment setting TMP or TEMP to avoid the warning.

    Hope it helps,

    -- JaWi

    "A chicken is an egg's way of producing more eggs."

Re: Problems using PDF::API2
by Cody Pendant (Prior) on Jan 23, 2003 at 08:35 UTC
    It's not "bombing". It's warning, like you asked it to with -w. Does it die at that point? Are there any symptoms apart from this warning?

    Also, many monks will look askance at your non-module processing of the POST, not that you asked...
    --
    “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.” M-J D

Re: Problems using PDF::API2
by Popcorn Dave (Abbot) on Jan 29, 2003 at 06:23 UTC
    Thanks to both of you for the help!

    There is no emoticon for what I'm feeling now.