Skip to content

fix: fix codes to separate the code and the comments #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions chapter4.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ PDF文档中的页面字典汇集了使用这些指令使用的资源(字体

|键|值类型|值|
|---|---|---|
|/Type* |name|必须是/Pages|
|/Type* |name|必须是/Page|
|/Parent* |间接引用字典|页面树中此节点的父节点|
|/Resources|dictionary|页面的资源(字体,图像等)。如果完全省略此条目,则资源将从页面树中的父节点继承。如果确实没有资源,请包含此条目但使用空字典|
|/Contents|indirect reference to stream or array of such references|一个或多个部分中页面的图形内容。如果缺少此条目,则页面为空|
Expand Down Expand Up @@ -193,16 +193,16 @@ endobj

```
%PDF-1.0 文件头
1 0 obj Top-level of page tree: has two children—page one and an intermediate page tree node
1 0 obj % Top-level of page tree: has two children—page one and an intermediate page tree node
<< /Kids [2 0 R 3 0 R] /Type /Pages /Count 3 >>
endobj
4 0 obj Contents stream for page one
4 0 obj % Contents stream for page one
<< >>
stream
1. 0.000000 0.000000 1. 50. 770. cm BT /F0 36. Tf (Page One) Tj ET
endstream
endobj
2 0 obj Page one
2 0 obj % Page one
<<
/Rotate 0
/Parent 1 0 R
Expand All @@ -213,9 +213,9 @@ endobj
/Contents [4 0 R]
>>
endobj
5 0 obj Document catalog
5 0 obj % Document catalog
<< /PageLayout /TwoColumnLeft /Pages 1 0 R /Type /Catalog >> endobj
6 0 obj Page three
6 0 obj % Page three
<<
/Rotate 0
/Parent 3 0 R
Expand All @@ -226,10 +226,10 @@ endobj
/Contents [7 0 R]
>>
endobj
3 0 obj Intermediate page tree node, linking to pages two and three
3 0 obj % Intermediate page tree node, linking to pages two and three
<< /Parent 1 0 R /Kids [8 0 R 6 0 R] /Count 2 /Type /Pages >>
endobj
8 0 obj Page two
8 0 obj % Page two
<<
/Rotate 270
/Parent 3 0 R
Expand All @@ -240,20 +240,20 @@ endobj
/Contents [9 0 R]
>>
endobj
9 0 obj Content stream for page two
9 0 obj % Content stream for page two
<< >>
stream
q 1. 0.000000 0.000000 1. 50. 770. cm BT /F0 36. Tf (Page Two) Tj ET Q
1. 0.000000 0.000000 1. 50. 750 cm BT /F0 16 Tf ((Rotated by 270 degrees)) Tj ET
endstream
endobj
7 0 obj Content stream for page three
7 0 obj % Content stream for page three
<< >>
stream
1. 0.000000 0.000000 1. 50. 770. cm BT /F0 36. Tf (Page Three) Tj ET
endstream
endobj
10 0 obj Document information dictionary
10 0 obj % Document information dictionary
<<
/Title (PDF Explained Example)
/Author (John Whitington)
Expand All @@ -263,7 +263,7 @@ endobj
>>
endobj xref
0 11
trailer Trailer dictionary
trailer % Trailer dictionary
<<
/Info 10 0 R
/Root 5 0 R
Expand Down
1 change: 1 addition & 0 deletions chapter5.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ c运算符再采用三个坐标:第一个控制点,第二个控制点和终
h B % 封闭路径并填充
```
![图 5-5](./images/figure%205-5.png)

我们使用g运算符来设置填充颜色。这在第60页的“颜色和颜色空间”中进行了解释。
对于第二条曲线,我们使用了y运算符,它类似于c,除了第二个控制点和终点是同一个,所以只有四个需要操作数。

Expand Down
10 changes: 5 additions & 5 deletions chapter6.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ PDF采用中间立场 - 保留了字体和小尺寸文本布局的思想,

举个例子,我们回到第2章中的“Hello,World!”文件:
```
1. 0. 0. 1. 50. 700. cm Position at (50, 700)
BT Begin text block
/F0 36. Tf Select /F0 font at 36pt
(Hello, World!) Tj Place the text string
ET End text block
1. 0. 0. 1. 50. 700. cm% Position at (50, 700)
BT% Begin text block
/F0 36. Tf% Select /F0 font at 36pt
(Hello, World!) Tj% Place the text string
ET% End text block
```

在这里,我们使用带有字体名称和大小运算符的Tf运算符来选择字体,使用Tj运算符来显示文本字符串。
Expand Down