Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi Punitha,

I tested this code firstly with a PDF file I knew had the information you are looking for, and your script ran properly, printing the expected results. Then I created a document using Open Office Writer, exported it to PDF (In the 'PDF Options' tab I unchecked the 'Tagged PDF' and 'Export Notes' options) and experienced the errors you mention.
Use of uninitialized value in concatenation (.) or string at li +ne 9. Use of uninitialized value in concatenation (.) or string at li +ne 9. 1.4

Then I opened the PDF and displayed the 'Document Properties', only the PDF version and Producer tags have values, hence the 1.4 printing out. I think then that you can assume your problem occurs when these values are not populated either in the source document before conversion, or later in Acrobat writer.
If you want to catch these errors take a look at this basic example:
#!/usr/bin/perl use strict; use warnings; use PDF; my $pdf = PDF->new("003.pdf"); my $version = $pdf->Version; my $title = $pdf->GetInfo("Title"); my $author = $pdf->GetInfo("Author"); if ($version){ print "\nVersion: $version"; }else{ print "\nVersion: Undefined"; } if ($title){ print "\nTitle: $title"; }else{ print "\nTitle: Undefined"; } if ($author){ print "\nAuthor: $author\n"; }else{ print "\nAuthor: Undefined\n"; }

Hope this helps.


In reply to Re: Retrieve the PDF file description by marto
in thread Retrieve the PDF file description by Punitha

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?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (3)
    As of 2018-02-19 18:52 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (266 votes). Check out past polls.