objec概念和种类

翻译:

英文:

The syntax of PDF comprises the four main elements:

• These are the basic building blocks in PDF.Objects.

• It specifies how objects are laid out and modified in a PDF file.File structure.

• It determines how objects are logically organized to represent the contents of a PDF file (text, graphics, etc.).Document structure.

• They provide a means for efficient storage of various parts of the document content.Content streams.

翻译:

PDF中有9种基本对象类型。简单对象类型有布尔型、数值型、字符串型和Null型。PDF字符串的长度有界,并用括号“(”和“)括起来。类型名称用作PDF文档结构描述中的标识符。名称是使用字符“”引入的,可以包含除null(0x00)以外的任意字符。上述5种对象类型在本文中称为基元类型。数组是包含在方括号“[”和“]”中的PDF对象的一维有序集合。数组可能包含不同类型的PDF对象,包括嵌套数组。字典是包含在符号“”和“”之间的无序键值对集。键必须是名称对象,并且在字典中必须是唯一的。这些值可以是任何PDF对象类型,包括嵌套字典。流对象是后跟字节序列的PDF字典。字节表示可以压缩或加密的信息,关联的字典包含是否以及如何解码字节的信息。这些字节通常包含要呈现的内容,但也可能包含一组其他对象[3]。最后,间接对象是任何先前定义的对象,该对象具有唯一的对象标识符,并包含在关键字obj和endobj中。由于间接对象具有唯一的标识符,因此可以通过间接引用从其他对象引用间接对象。/<<>>

英文:

There are 9 basic object types in PDF. Simple object types are Boolean, Numeric, String and Null. PDF strings have bounded length and are enclosed in parentheses '(' and ')'. The type Name is used as an identifier in the description of the PDF document structure. Names are introduced using the character '' and can contain arbitrary characters except null (0x00). The aforementioned 5 object types will be referred to as primitive types in this paper. An Array is a one-dimensional ordered collection of PDF objects enclosed in square brackets, '[' and ']'. Arrays may contain PDF objects of different type, including nested arrays. A Dictionary is an unordered set of key-value pairs enclosed between the symbols '' and ''. The keys must be name objects and must be unique within a dictionary. The values may be of any PDF object type, including nested dictionaries. A Stream object is a PDF dictionary followed by a sequence of bytes. The bytes represent information that may be compressed or encrypted, and the associated dictionary contains information on whether and how to decode the bytes. These bytes usually contain content to be rendered, but may also contain a set of other objects[3]. Finally, an Indirect object is any of the previously defined objects supplied with a unique object identifier and enclosed in the keywords obj and endobj. Due to their unique identifiers, indirect objects can be referenced from other objects via indirect references./<<>>

字典对象(Dictionary Objects)的例子:

流对象的例子:

Indirect Objects的例子:

---------------------------------------------------

File structure

This  escribes how objects are organized in a PDF file for efficient random access and incremental update. A basic conforming PDF file shall be constructed of following four elements (see Figure 2):
• A one-line header identifying the version of the PDF specification to which the file conforms
• A body containing the objects that make up the document contained in the file
• A cross-reference table containing information about the indirect objects in the file
• A trailer giving the location of the cross-reference table and of certain special objects within the body of the file .

The body of a PDF file shall consist of a sequence of indirect objects representing the contents of a document. The objects, which are of the basic types described in 7.3, "Objects," represent components of the document such as fonts, pages, and sampled images. Beginning with PDF 1.5, the body can also contain object streams, each of which contains a sequence of indirect objects; see 7.5.7, "Object Streams."

PDF文件的Body应由表示文件内容的一系列间接对象组成。对象属于7.3“对象”中描述的基本类型,表示文档的组件,如字体、页面和采样图像。从PDF 1.5开始,主体还可以包含对象流,每个对象流包含一系列间接对象;见7.5.7“对象流”

以下列表显示了来自真实PDF文件的示例性结构路径:(BODY)

PDF对象的语法如图1左侧所示的简化示例性PDF文件所示。它包含四个由两部分对象标识符表示的间接对象,例如,第一个对象为1 0,以及obj和endobj关键字。这些对象是字典,因为它们被符号“”和“”包围。第一个是目录字典,由其类型条目表示,该条目包含一个带有值Catalog的PDF名称。该目录有两个额外的字典条目:Pages和OpenAction。OpenAction是嵌套字典的一个示例。它有两个条目:S,一个表示这是JavaScript动作字典的PDF名称,和JS,一个包含要执行的实际JavaScript脚本的PDF字符串:alert('Hello!');。Pages是对对象标识符为3 0的对象的间接引用:目录后面紧跟的Pages字典。它有一个整数Count,表示文档中有2个页面,还有一个由方括号标识的数组,其中有两个对页面对象的引用。相同的对象类型用于构建其余的页面对象。请注意,每个页面对象在其父条目中都包含对页面对象的反向引用。总共有三个引用指向同一个间接对象3 0,即Pages对象。<<>>

各种基本对象之间的关系构成了PDF文件的逻辑树形文档结构,如图1的中间部分所示。文档结构中的节点本身就是对象,边与子对象在父对象中的名称相对应。对于数组,父子关系是无名的,对应于单个元素的整数索引。请注意,严格地说,文档结构不是一棵树,而是一个有方向的潜在循环图,因为间接引用可能指向文档结构中任何位置的其他对象。文档结构中的根节点是一个特殊的PDF字典,其强制类型条目包含名称目录。原语类型的任何对象都构成文档结构中的叶。

----------------------------------------------------

7.5.4 Cross-Reference Table

The cross-reference table contains information that permits random access to indirect objects within the file so that the entire file need not be read to locate any particular object. The table shall contain a one-line entry for each indirect object, specifying the byte offset of that object within the body of the file.

交叉引用表包含允许对文件中的间接对象进行随机访问的信息,因此无需读取整个文件来定位任何特定对象。该表应包含每个间接对象的一行条目,指定该对象在文件正文中的字节偏移量。(从PDF 1.5开始,部分或全部交叉参考信息也可以包含在交叉参考流中;请参见7.5.8“交叉参考流”。

其中

xref代表Cross-Reference Table的开始

0 代表起始object number

26 代表此表格indirect object entry的个数

n 代表 in-use, f 代表 free

交叉参考表(包括原始交叉参考部分和所有更新部分)应包含从0到文件中定义的最大对象编号的每个对象编号的一个条目,即使该范围内的一个或多个对象编号实际上并未出现在文件中。

注意: ggggg 是生成号,可以看作是版本号。

7.5.5 File Trailer

The trailer of a PDF file enables a conforming reader to quickly find the cross-reference table and certain special objects. Conforming readers should read a PDF file from its end. The last line of the file shall contain only the end-of-file marker, %%EOF. The two preceding lines shall contain, one per line and in order, the keyword startxref and the byte offset in the decoded stream from the beginning of the file to the beginning of the xref keyword in the last cross-reference section. The startxref line shall be preceded by the trailer dictionary, consisting of the keyword trailer followed by a series of key-value pairs enclosed in double angle brackets (<< … >>) (using LESS-THAN SIGNs (3Ch) and GREATER-THAN SIGNs (3Eh)). Thus, the trailer has the following overall structure:

Document structure

PDF 文档可以被视为包含在 PDF 文件Body部分中的对象的层次结构。 在
层次结构的根是文档的目录字典(catalog dictionary)。

例子:

每一页都由一个页面对象表示,该对象是一个字典,其中包括对页面内容和其他属性的引用,例如其缩略图(12.3.4,“缩略图”)和与之相关的任何注释(12.5,“注释”)。各个页面对象在一个称为页面树(如7.7.3“页面树”所述)的结构中绑定在一起,而页面树又由文档目录中的间接引用指定(an indirect reference in the document catalog)。层次结构中的父、子和同级关系由字典项定义,这些字典项的值是对其他字典的间接引用。

文档对象层次结构的根是目录字典( catalog dictionary),通过PDF文件Root entry in the trailer(见7.5.5,“文件尾部”)。目录包含对定义文档内容、大纲、文章线程、命名目的地和其他属性的其他对象的引用。此外,它还包含有关如何在屏幕上显示文件的信息,例如是否应自动显示文件的大纲和缩略页面图像,以及打开文件时是否应显示除第一页以外的其他位置。表28显示了目录字典中的条目。

7.7.3.3
Page Objects

 

7.7.3.4页面属性的继承

表30中所示的一些页面属性被指定为可继承的。如果页面对象中省略了此类属性,则其值应从页面树中的祖先节点继承。如果属性是必需的,则应在祖先节点中提供一个值。如果属性是可选的且未指定继承值,则应使用默认值。

因此,通过在中间页面树节点中指定属性并将共享该属性的页面排列为该节点的子节点,可以为整个页面集定义一次属性。pdf

pdf reference官方指南之-语法基础和文件结构相关推荐

  1. Java基础笔记(入门,语法基础,流程控制,数组)

    Java语言入门 发展历程 三大技术体系 JavaSE 标准版 JavaEE 企业版 JavaME 嵌入式版 Java语言特点 简单性 健壮性 面向对象 分布式 多线程 动态性 可移植性(跨平台) J ...

  2. pdf reference 格式具体说明

    1. PDF概要 1.1. 图像模型 PDF能以平台无关.高效率的方式描叙复杂的文字.图形.排版. PDF 用图像模型来实现设备无关. 图像模型同意应用程序以抽象对象描叙文字.图像.图标.而不是通过详 ...

  3. PHP面试题及答案解析(1)—PHP语法基础

    1. strlen( )与 mb_strlen( )的作用分别是什么? strlen和mb_strlen都是用于获取字符串长度. strlen只针对单字节编码字符,也就是说它计算的是字符串的总字节数. ...

  4. pdf reference 格式详细说明

    1. PDF概要 1.1. 图像模型 PDF能以平台无关.高效率的方式描叙复杂的文字.图形.排版. PDF 用图像模型来实现设备无关.图像模型允许应用程序以抽象对象描叙文字.图像.图标,而不是通过具体 ...

  5. latex_1_安装及语法基础入门

    latex安装及语法基础入门 1.LaTeX环境的安装与配置 2.LaTeX源文件的基本结构 3.LaTeX中的中文处理方法 4.LaTeX的字体设置 5.LaTeX的篇章结构 6.LaTeX中的特殊 ...

  6. 第02章 Python语法基础,IPython和Jupyter Notebooks

    第2章 Python语法基础,IPython和Jupyter Notebooks 当我在2011年和2012年写作本书的第一版时,可用的学习Python数据分析的资源很少.这部分上是一个鸡和蛋的问题: ...

  7. (数据分析)第02章 Python语法基础,IPython和Jupyter Notebooks.md

    第2章 Python语法基础,IPython和Jupyter Notebooks 当我在2011年和2012年写作本书的第一版时,可用的学习Python数据分析的资源很少.这部分上是一个鸡和蛋的问题: ...

  8. 《利用Python进行数据分析·第2版》第2章 Python语法基础,IPython和Jupyter Notebooks

    第 1 章 准备工作 第 2 章 Python 语法基础,IPython 和 Jupyter Notebooks 第 3 章 Python 的数据结构.函数和文件 第 4 章 NumPy 基础:数组和 ...

  9. 《利用Python进行数据分析·第2版》第2章 Python语法基础,IPython和Jupyter Notebooks...

    第1章 准备工作 第2章 Python语法基础,IPython和Jupyter Notebooks 第3章 Python的数据结构.函数和文件 第4章 NumPy基础:数组和矢量计算 第5章 pand ...

  10. 给Java初学者福利——Java语法基础

    Java代码基本格式 Java中所有程序代码都必须存在于一个类中,用class关键字定义类,在class之前可以有一些修饰符.格式如下: 修饰符 class 类名 { 程序代码 } 注: 1.Java ...

最新文章

  1. 手机加速度计数据可以被随意读取,iOS关不掉权限,安卓这次能限制
  2. 机器学习入门学习笔记:(2.4)线性判别分析理论推导
  3. Android和JS之间互相调用方法并传递参数
  4. 计算机二级vf笔试,计算机二级(VF)笔试120.doc
  5. 状态输出导航栏html,css3与html5实现响应式导航菜单(导航栏)效果分享
  6. 灵魂拷问,SQL 查询语句先执行 SELECT吗?
  7. PHP排雷之编码问题
  8. 虫术python绝技_《圣济总录》
  9. Windows 查看端口使用情况
  10. 移植 Qt4.8.5到Tiny210
  11. axure 破解 key
  12. 一个正经的前端学习 开源 仓库(阶段二十一)
  13. 汇编版|电子印章在各类业务文件中的应用
  14. android pc游戏模拟器哪个好用,哪个电脑手游模拟器好用 安卓手游模拟器测试对比排行榜...
  15. 插入安装光盘并重新启动计算机,电脑开机时显示 插入windows安装光盘并重新启动计算机 怎么解决 急救...
  16. 程序员有多喜欢树莓派?这7个开发套件让他们爱不释手!
  17. 纯CSS自定义checkbox对号
  18. 你知道什么叫“无差别沟通”吗
  19. 利用vue实现树表格分页
  20. 淘宝、1688代购系统;代购程序,代购系统源码PHP前端源码

热门文章

  1. java.lang.UnsupportedOperationException WebView is not allowed in privileged processes
  2. [环境搭建]-Web Api搭建到IIS服务器后PUT请求返回HTTP Error 405.0 - Method Not Allowed 解决方法
  3. git clone 非空目录
  4. matlab三维怎么转换二维,求助,二维图像如何绕轴旋转成为三维图像
  5. 前端页面怎么办啊一条长的信息换行展示_前端入门!不容错过!HTML基本标签知识大盘点...
  6. mysql集群和memcached_Memcached 高可用集群架构
  7. conda 安装本地包_export包本地安装以及R包被CRAN移除后如何继续安装
  8. java .entryset_Java中map的entrySet()方法返回的是什么内容啊?有点晕
  9. 最快的 java 图像_java – 最快的性能过滤图像
  10. 安卓手机反应慢又卡怎么办_安卓手机出现卡顿反应慢的具体处理方法