オブジェクト構造

Document structure

f:id:yossan2:20210616231152p:plain
オブジェクト階層 in PDF

  • indirect object 相互参照テーブルからオフセット位置を読み取ることが出来るオブジェクト (名前付きオブジェクトと呼ばれることもある。)
  • direct object indirect object以外のオブジェクト。 オブジェクト階層では唯一トレーラー辞書のみがdirect dictionaryとなっており、読み取るために、ファイル構造で定義されたオブジェクト配置戦略が必要となる。

Trailer Dictionary

オブジェクトグラフのルートオブジェクト。

trailer
<< /Size 46 /Root 24 0 R /Info 1 0 R /ID [ <378d78094ee3afcd9aa56448d2631c29>
<378d78094ee3afcd9aa56448d2631c29> ] >>
Key Value type Value
/Size Integer 相互参照テーブルのentityの総数。
/Root 辞書への参照(indirect reference) ドキュメントカタログへの参照
/Info 辞書への参照(indirect reference) ドキュメントのドキュメント情報辞書
/ID 2つのStringで構成された配列 作成IDと更新ID

Document Information Dictionary

作成日、更新日などファイルのメタ情報が記載されている。

1 0 obj
<< /Title 42 0 R /Producer 43 0 R /Creator 44 0 R /CreationDate 45 0 R /ModDate
45 0 R >>
endobj
<<
   /ModDate (D:20060926213913+02'00')
   /CreationDate (D:20060926213913+02'00')
   /Title (catalogueproduit-UK.qxd)
   /Creator (QuarkXPress: pictwpstops filter 1.0)
   /Producer (Acrobat Distiller 6.0 for Macintosh)
   /Author (James Smith)
>>
Key Value type Value
/Title text文字列 ドキュメントタイトル。最初のページで表示されるタイトルとはいかなる関係もない。
/Subject text文字列 副題
/Keywords text文字列 ドキュメントに関連するキーワード
/Author text文字列 ドキュメントの著作者
/CreationDate date文字列 作成日
/ModDate date文字列 更新日
/Creator text文字列 このPDFのオリジナル。例: "Microsoft Word"
/Producer text文字列 PDFを生成したアプリケーション

Document Catalog

メインオブジェクトグラフのルートオブジェクト。

24 0 obj
<< /Type /Catalog /Metadata 2 0 R /Pages 4 0 R >>
endobj
Key Value type Value
/Type name 必ず /Catalog
/Pages 辞書への参照(indirect reference) ページツリーのルートノード。
/PageLabels number tree ページへのラベル。例: i,ii,iii,...。電子デバイス上のViewerには表示されるが、印刷はされない。
/Names dictionary The name dictionary.
/Dests dictionary nameとdestinationマッピング辞書。destinationは、PDFドキュメント内部へのハイパーリンクを表す。
/Outlines 辞書への参照 目次

Page Tree

Pages

ページツリーのルートノード。

4 0 obj
<< /Type /Pages /MediaBox [0 0 612 792] /Count 2 /Kids [ 3 0 R 20 0 R ] >>
endobj
3 0 obj
<< /Type /Pages /Kids [
4 0 R
7 0 R
9 0 R
73 0 R
11 0 R
] /Count 5
/Rotate 0>>
endobj
Key Value type Value
/Type name 必ず /Pages
/Kids 参照への配列 直下のこのノードの子ページツリー
/Count integer ページ数
/Parent ページツリーノードへの参照 このノードの親への参照。

Page

ページ情報。ContentsやResourceへの参照を持つ。

3 0 obj
<< /Type /Page /Parent 4 0 R /Resources 7 0 R /Contents 5 0 R /MediaBox [0 0 612 792]
>>
20 0 obj
<< /Type /Page /Parent 4 0 R /Resources 23 0 R /Contents 21 0 R /MediaBox
[0 0 612 792] >>
endobj
4 0 obj
<</Type/Page/MediaBox [0 0 612 792]
/Rotate 0/Parent 3 0 R
/Resources<</ProcSet[/PDF /Text]
/ExtGState 41 0 R
/Font 42 0 R
>>
/Annots[13 0 R
14 0 R
15 0 R
16 0 R
17 0 R
18 0 R
19 0 R
20 0 R
21 0 R
22 0 R
23 0 R
24 0 R
25 0 R
26 0 R]/Contents 30 0 R
>>
endobj
/MediaBox [0 0 500 800]
/CropBox [100 100 400 700]
Key Value type Value
/Type name 必ず /Page
/Parent 辞書への参照 ページツリーの親ノード
/Resources dictionary font,imageなどのページリソース情報。リソースが存在しない場合は、空辞書が指定される。
/Contents ストリームへの参照 or 参照の配列 一つ以上のセクションにおける描画ページコンテンツ。ページが空の場合は、このエントリーが存在しない。
/Rotate integer ページの回転。時計回りでdegreeで表せる。
/MediaBox rectangle 紙のサイズ。
/CropBox rectangle ページの切り取りサイズ。印刷領域を表す。

Page Contents

5 0 obj
<< /Length 1074 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( A Simple PDF File ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( This is a small demonstration .pdf file - ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( just for use in the Virtual Mechanics tutorials. More text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 628.8480 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 616.8960 Td
( text. And more text. Boring, zzzzz. And more text. And more text. And ) Tj
ET
BT
/F1 0010 Tf
69.2500 604.9440 Td
( more text. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 592.9920 Td
( And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 569.0880 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 557.1360 Td
( text. And more text. And more text. Even more. Continued on page 2 ...) Tj
ET
endstream
endobj

Page Resources