Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
monsters [2021/07/20 08:57] christian [Monsters from the wild] |
monsters [2021/07/23 17:41] christian [Incorrect stream length] |
||
---|---|---|---|
Line 8: | Line 8: | ||
This page describes some of the problems encountered in real PDFs from the wild and discusses ways to deal with such situations. | This page describes some of the problems encountered in real PDFs from the wild and discusses ways to deal with such situations. | ||
+ | |||
===== Missing object ===== | ===== Missing object ===== | ||
- | An attribute of an object has a reference pointing to a free reference in the cross references, i.e. the object is not in the file. | + | An attribute of an object has a reference pointing to a free reference in the cross references. |
- | When writing out such an object, a string '' | + | === Example === |
- | Seen in '' | + | Referencing indirect object (2 0): the ''/ |
- | * '' | + | |
- | * '' | + | <code pdf> |
+ | 1 0 obj | ||
+ | << | ||
+ | /Outlines 2 0 R | ||
+ | /Pages 3 0 R | ||
+ | >> | ||
+ | endobj | ||
+ | </ | ||
+ | |||
+ | The cross reference section | ||
+ | <code pdf> | ||
+ | xref | ||
+ | 0 7 | ||
+ | 0000000000 65535 f | ||
+ | 0000000009 00000 n | ||
+ | 0000000000 65535 f | ||
+ | 0000000131 00000 n | ||
+ | ... % 4 more | ||
+ | </ | ||
+ | |||
+ | The reference to object (2 0) is the 3rd entry in the '' | ||
+ | |||
+ | === Handling === | ||
+ | |||
+ | A proceedable '' | ||
+ | |||
+ | When writing out the reference to a new PDF, a string '' | ||
+ | |||
+ | === Reference === | ||
+ | |||
+ | Seen in '' | ||
===== Incorrect stream length ===== | ===== Incorrect stream length ===== | ||
- | The dictionary part of a stream | + | The ''/ |
+ | |||
+ | === Example === | ||
+ | |||
+ | < | ||
+ | 42 0 obj | ||
+ | <</ | ||
+ | stream | ||
+ | abcdefghij | ||
+ | endstream | ||
+ | endobj | ||
+ | </ | ||
+ | |||
+ | In the example, the stream contents in the file is '' | ||
+ | |||
+ | === Handling === | ||
+ | |||
+ | The library handles one specific instance | ||
+ | |||
+ | If there are more bytes extra, a '' | ||
+ | |||
+ | === Reference === | ||
- | Seen in '' | + | Seen in '' |
- | * '' | + |