PDF文件存储结构

PDF文件由文件头(版本号)、文件体(对象)、交叉索引表、和文件尾四部分组成。

%PDF-1.4 % 文件头,显示版本信息



% 文件体,存储着1 ~ n 个间接对象,其内部可以是所有类型的基础对象(请查看PDF基础对象)。


1 0 obj % 间接对象头,表示 索引号为1,更新号(在文档增量更新的时候会用到)为 0
<<
/Type /Pages
/Kids [2 0 R] % kids under this node. 
% Can be another page tree node, or a page dictionary
/Count 1
>>
endobj % 间接对象结束标记

2 0 obj % 索引号为2 的间接对象

...

endobj

……

n 0 obj  % 索引号为n 的间接对象

……

endobj


xref % Cross reference table. 
         % Should contain byte offsets of all indirect objects

1 n

xxxxxxxxxxxx 00000 n % 索引号为1的间接对象在文件中的偏移位置

xxxxxxxxxxxx 00000 n % 索引号为n的间接对象在文件中的偏移位置

……

xxxxxxxxxxxx 00000 n % 索引号为n的间接对象在文件中的偏移位置


trailer % 文件尾,文件尾必须包含Size(间接对象个数)、Info、
<<
/Size 0 % should be the size of cross reference table
% we use 0 here for convenience.
/Info 7 0 R     % doc info for Author and so on
/Root 3 0 R % pointer to the catalog object 指向
>>


startxref
0 % this should be the offset to the cross reference table.
% We use 0 here for convenience.
%%EOF % end of file
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值