Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Greetings to all monks,

 

I have the following problem and request your counsel. An external vendor generates over 100 PDF files every Sun. Due to historical problems, the on-call (aka me once every 4 weeks) has to log in at ~1am every Mon and open ~30 random files to make sure they "seem" correct. Once all are "validated" they are printed and must be received by 9am containing "correct" values.

 

Each file is a report generated by MicroStrategy and contains a number of complex tables of retail data (wtd, , mtd, ytd, ly, etc.) I have a perl scripts that count the total number of files, compare current sizes to historical averages, etc. but many “bad” files continue to slip through to eventual Sev 2 ticketdom.

 

Based on historical posts here, it looks like converting PDF with complex tables to either HTML or TXT is not pretty and not advisable. (side note: these posts are from 2002-2004). To this novice, a good solution would be to be able to parse the PDF file directly. Hence my questions:

 

1) Are there “open source” methods to perform regexp's on PDF files?

2) If not, do current PDF to TXT/HTML converters handle complex tables better?

3) If not, would converting PDF to DOC and then using DOC parsers be a practical and advisable solution?

 

Thank you,

--BLP


In reply to How to parse PDF by BuddhaLovesPerl

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-19 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found