Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
monsters [2021/07/23 17:31]
christian [Missing object]
monsters [2021/07/24 07:53]
christian [Incorrect stream length]
Line 15: Line 15:
 === Example === === Example ===
  
-Referencing indirect object (2 0)+Referencing indirect object (2 0): the ''/Outlines''
  
 <code pdf> <code pdf>
Line 41: Line 41:
 === Handling === === Handling ===
  
-This will raise a ''MissingObjectError'' with a ''MissingObject'' containing the type information for the expected object as parameter.+A proceedable ''MissingObjectError'' is raised. The reference points to a ''MissingObject'' containing the expected type.
  
 When writing out the reference to a new PDF, a string ''(The original object is missing)'' is written as object instead (if type information is available, it is added to the message). This preserves the correct reference which may be used in several places. Subsequently, this will result in a type mismatch when reading that PDF (unless the original object was a string as well, which is unlikely). When writing out the reference to a new PDF, a string ''(The original object is missing)'' is written as object instead (if type information is available, it is added to the message). This preserves the correct reference which may be used in several places. Subsequently, this will result in a type mismatch when reading that PDF (unless the original object was a string as well, which is unlikely).
Line 51: Line 51:
 ===== Incorrect stream length ===== ===== Incorrect stream length =====
  
-The ''/Length'' of a stream is smaller than the number of bytes.+The ''/Length'' of a stream is different from the size of the content. Ths content are the bytes between token ''stream'', followed by one ''lf'', and token ''endstream'' with optional extra whitespace before the token. 
 + 
 +The following cases are possible: 
 +  * ''/Length'' is smaller than the content. The ''endstream'' token lies ahead. 
 +  * ''/Length'' is larger than the content.  The ''endstream'' token, or parts of it, has been read as part of the stream already. 
 + 
 +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 than the number of bytes given by the ''/Length'' attribute.
  
 === Example === === Example ===
Line 57: Line 63:
 <code> <code>
 42 0 obj 42 0 obj
-<</Length 9>> + <</Length 9>> 
-stream+ stream
 abcdefghij abcdefghij
-endstream+ endstream
 endobj endobj
 </code> </code>
Line 74: Line 80:
 === Reference === === Reference ===
  
-Seen in ''/info/Producer'': ''Bluebeam PDF Library 18''+Seen in ''/Info/Producer'': ''Bluebeam PDF Library 18''
  • monsters.txt
  • Last modified: 2021/07/24 08:12
  • by christian