Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
this was working last week, I made a few changes to some text in the perl but nothing that would stop it from working. on the line my $page = $pdf->openpage(1); the script will stop and give me a error
Can't call method "infilt" on an undefined value at /usr/lib/perl5/site_perl/5.8.5/PDF/API2/Util.pm line 667 (#1) (F) You used the syntax of a method call, but the slot filled by t +he object reference or package name contains an undefined value. Som +ething like this will reproduce the error: $BADREF = undef; process $BADREF 1,2,3; $BADREF->process(1,2,3); Uncaught exception from user code: Can't call method "infilt" on an undefined value at /usr/lib/p +erl5/site_perl/5.8.5/PDF/API2/Util.pm line 667. at /usr/lib/perl5/site_perl/5.8.5/PDF/API2/Util.pm line 667 PDF::API2::Util::unfilter('PDF::API2::Basic::PDF::Name=HASH(0x +96dc8a8)', 'H\x{89}\x{8c}V\x{c9}n\x{db}0\x{10}\x{bd}\x{eb}+\x{e6}\x{d +8}\x{1e}\x{c2}p\x{19}.\x{2}\x{c}\x{1}\x{b1}Q\x{17}H\x{da}K#\x{a0}\x{8 +7} (\x{8c}\x{d4}M\x{9d}\x{ca}\x{d}*\x{c7}\x{9}\x{d2}\x{af}\x{ef}p\x{9 +3}(;As\x{90}\x{c4}ef\x{de}\x{9b}\x{e1}\x{a3}\x{c8}?...') called at /u +sr/lib/perl5/site_perl/5.8.5/PDF/API2.pm line 991 PDF::API2::openpage('PDF::API2=HASH(0x93b0a10)', 1) called at +/opt/apache-tomcat-5.5.12/webapps/CalculatorPrinting/WEB-INF/cgi/HPSO +AReport.pl line 510
I can't figure out why its haulting at this point, I created a template in Adobe indesign and saved it as a PDF, in which i have API2 open it and add some content, again this all worked last week I checked the indesign for the compression and i have no compression on it at all, so I am not sure the problem is there or not. here is the are where it is failing ( the complete code is too large to put here, strict and warnings are used)
########################### MAKE PDF ############################ my $Template = 'HP_SOA_Assement.pdf'; my $pdf = PDF::API2->open($Template); my $page = $pdf->openpage(1); ##### Set Font ############### my %font = ( Helvetica => { Bold => $pdf->corefont('Helvetica-Bold', -encoding => +'utf-8'), Roman => $pdf->corefont('Helvetica', -encoding => +'utf-8'), Italic => $pdf->corefont('Helvetica-Oblique', -encoding => +'utf-8'), }, Futura => { Bold => $pdf->ttfont('FtraHv__.ttf', -encoding => 'utf +-8'), Medium => $pdf->ttfont('FtraMd__.ttf', -encoding => 'u +tf-8'), Lite => $pdf->ttfont('FtraLt__.ttf', -encoding => 'utf- +8'), }, ); ## Set Text ############### newText($fontType, 'Bold', 12/pt, 'black', 13/mm, 91/mm, $valueHash{" +forCover"}); newText($fontType, 'Bold', 10/pt, 'black', 13/mm, 81/mm, $valueHash{" +byCover"}); ######################################## PAGE 2 #################### +##################################### $page = $pdf->openpage(2); sub newText{ my $flashVars = $page->text; $flashVars->font( $font{$_[0]}{$_[1]}, $_[2] ); $flashVars->fillcolor( $_[3] ); $flashVars->translate( $_[4], $_[5] ); $flashVars->text( $_[6] ); }
Any Ideas as to why this is happening?

In reply to Open page error for PDF::API2 by ikkon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (3)
    As of 2021-04-16 19:39 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?