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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
... and the need of the file to be converted (e.g. newlines).

I think you meant to say

... and the need of the file not to be converted ... :)

Always treat PDFs as binary files! Line endings conversions will surely ruin the file.

Actually, this could be the problem here. Maybe ikkon uploaded the file to the webserver via FTP, and forgot to set binary mode? Just an idea. It's hard to tell what the real problem is without being able to take a look at the PDF file.

That conversion appears to be done by the filters.

Not quite (at least not if "that" refers to "newline"). The filters handle just the de/encoding of the stream part of the PDF objects1. Typically, filters are being used for compressing data, but there are other uses as well.

In case your PDF file should turn out not to be broken otherwise, maybe it's making use of some fancy filter that PDF::API2 doesn't implement (yet). This might possibly lead to the method infilt being called on an undefined filter object eventually... (which is the error you're observing). Just guessing again.

___

1  A little background: Roughly speaking, PDF files consist of a series of numbered objects. The numbers allow them to be referenced from within other objects. The objects themselves consist of a dictionary part (meta info), and an optional stream part (data). The latter may hold the drawing primitives that make up the text/graphics content of a page.   At the end of every PDF is an index table which lists the byte offsets of all objects in the file. This is mainly for performance / resource usage reasons, so some reader software can directly seek to the respective position where the required object is found, without having to parse the entire file (which makes sense when displaying just a single page from a document with hundreds of pages...). This direct indexing feature is one of the reasons why PDF files must be treated binary. As soon as you move around, or change the size of objects, the index table needs to be recomputed. This of course won't happen automagically when (size-modifying) Windows-to-Unix newline translations are being applied, for example... (though some readers will try to auto-fix a broken file).   Hope this helps :)


In reply to Re^2: Open page error for PDF::API2 by almut
in thread 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":



  • 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 scrutinizing the Monastery: (5)
As of 2024-04-19 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found