Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
monsters [2021/07/23 17:24] christian |
monsters [2021/07/24 08:12] (current) christian [Incorrect stream length] |
||
---|---|---|---|
Line 11: | Line 11: | ||
===== 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. This will raise a '' | + | An attribute of an object has a reference pointing to a free reference in the cross references. |
=== Example === | === Example === | ||
+ | |||
+ | 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 === | === Handling === | ||
+ | |||
+ | A proceedable '' | ||
When writing out the reference to a new PDF, a string '' | When writing out the reference to a new PDF, a string '' | ||
Line 25: | Line 51: | ||
===== Incorrect stream length ===== | ===== Incorrect stream length ===== | ||
- | The ''/ | + | The ''/ |
+ | |||
+ | The following cases are possible: | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | |||
+ | The particular monster where I encountered this, had always one byte too much in the content. Therefore, not the general problem was handled, but just the simple case where the content is exactly 1 larger | ||
=== Example === | === Example === | ||
Line 31: | Line 63: | ||
< | < | ||
42 0 obj | 42 0 obj | ||
- | <</ | + | <</ |
- | stream | + | stream |
abcdefghij | abcdefghij | ||
- | endstream | + | endstream |
endobj | endobj | ||
</ | </ | ||
Line 45: | Line 77: | ||
If there are more bytes extra, a '' | If there are more bytes extra, a '' | ||
+ | |||
+ | == Known problem == | ||
+ | |||
+ | The general problem has not been adressed. One idea is to find the end of the stream content of the current object. With this information it is possible to determine if the ''/ | ||
+ | |||
+ | The end of the stream would be before the '' | ||
+ | |||
+ | Object streams need not be considered, because they cannot contain streams. | ||
+ | |||
+ | This should be easy for the simple case of only one xref table. But handling several xrefs from different updates deemed too complex at the time (that' | ||
=== Reference === | === Reference === | ||
- | Seen in ''/ | + | Seen in ''/ |