Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If there are limits to what PDFs work and what don't I have not run into them :)

You've just been lucky so far :)

Some PS/PDF tools are using font subsetting/re-encoding techniques which (when done in a certain way) can make automatic text extraction very hard. (I've tried to explain the method in more detail in another thread.)

To illustrate, here's a sample PDF which you can view with Adobe Reader, xpdf, Ghostscript, etc. without problems (you should see the standard "lorem ipsum" text). Any attempt to extract the textual content will likely fail, however, although the file is a perfectly valid PDF containing nothing but regular text content (no images, no encryption, no other tricks) with all characters being part of the ASCII set.

Of course, I deliberately created the file in the above mentioned way (as "proof of concept"), but there are actually PDF creation tools out there which do produce such problematic PDFs.


In reply to Re^4: Extracting content text from PDFs by almut
in thread Extracting content text from PDFs by pat_mc

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 avoiding work at the Monastery: (3)
As of 2024-04-19 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found