Diana
Diana

Reputation: 51

Internal structure of PDF file: decode params

What the next parametres of decoding does mean?

<</DecodeParms<</Columns 4/Predictor 12>>/Filter/FlateDecode/ID[<4DC888EB77E2D649AEBD54CA55A09C54><227DCAC2C364E84A9778262D41602AD4>]/Info 37 0 R/Length 69/Root 39 0 R/Size 38/Type/XRef/W[1 2 1]>>

I know, that Filter/FlateDecode -- it's filter, which was used to compress the stream. But what are ID, Info, Length, Root, Size? Are these parametres realeted with compression/decompression?

Upvotes: 0

Views: 4592

Answers (1)

Bruno Lowagie
Bruno Lowagie

Reputation: 77528

Please consult ISO-32000-1:

You are showing the dictionary of a compressed cross reference table (/Type/XRef):

7.5.8 Cross-Reference Streams

Cross-reference streams are stream objects, and contain a dictionary and a data stream.

  • Flatedecode: the way the stream is compressed.
  • Length: This is the number of bytes in the stream. Your PDF is at least a PDF 1.5 file and it has a compressed xref table.
  • DecodeParms: contains information about the way the stream is encoded.

A Cross-reference stream has some typical dictionary entries:

  • W: An array of integers representing the size of the fields in a single cross-reference entry. In your case [1 2 1].
  • Size: The number one greater than the highest object number used in this section or in any section for which this shall be an update. It shall be equivalent to the Size entry in a trailer dictionary.

I also see some entries that belong in the /Root dictionary (aka Catalog) of a PDF file:

14.4 File Identifiers

File identifiers shall be defined by the optional ID entry in a PDF file’s trailer dictionary. The ID entry is optional but should be used. The value of this entry shall be an array of two byte strings. The first byte string shall be a permanent identifier based on the contents of the file at the time it was originally created and shall not change when the file is incrementally updated. The second byte string shall be a changing identifier based on the file’s contents at the time it was last updated. When a file is first written, both identifiers shall be set to the same value.

14.3.3 Document Information Dictionary

What you see is a reference to another indirectory object that is a dictionary called the Info dictionary:

The optional Info entry in the trailer of a PDF file shall hold a document information dictionary containing metadata for the document.

Note: this question isn't really suited for StackOverflow. StackOverflow is a forum where you can post programming problems. Your question isn't a programming problem. You are merely asking us to copy/paste quotes from ISO-32000-1.

Upvotes: 1

Related Questions