我刚发现了这篇文章:Adobe论坛:规范中的简单文本字符串示例已损坏。,因此我有兴趣找到纯文本源代码PDF示例。
通过那篇文章,我最终找到了: PDF 1.7规范在第699页的附录“附录H(信息性)示例PDF文件”中; 从那里开始,我想尝试“H.3 简单文本字符串示例”(经典的“Hello World”)。
所以我试图将其保存为
"...我正在尝试打开它:"
然而,evince无法打开它:“无法打开文档/PDF文档已损坏”; 同时:
我还使用
我在哪里做错了?
提前感谢任何回答,谢谢!
通过那篇文章,我最终找到了: PDF 1.7规范在第699页的附录“附录H(信息性)示例PDF文件”中; 从那里开始,我想尝试“H.3 简单文本字符串示例”(经典的“Hello World”)。
所以我试图将其保存为
hello.pdf
(除非你从PDF32000_2008.pdf复制时会得到“%PDF-1. 4
” - 也就是说,在1.
后面插入了一个空格,必须将其删除):%PDF-1.4
1 0 obj
<< /Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<< /Type /Outlines
/Count 0
>>
endobj
3 0 obj
<< /Type /Pages
/Kids [ 4 0 R ]
/Count 1
>>
endobj
4 0 obj
<< /Type /Page
/Parent 3 0 R
/MediaBox [ 0 0 612 792 ]
/Contents 5 0 R
/Resources << /ProcSet 6 0 R
/Font << /F1 7 0 R >>
>>
>>
endobj
5 0 obj
<< /Length 73 >>
stream
BT
/F1 24 Tf
100 100 Td
( Hello World ) Tj
ET
endstream
endobj
"...我正在尝试打开它:"
evince hello.pdf
然而,evince无法打开它:“无法打开文档/PDF文档已损坏”; 同时:
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table
我还使用
qpdf
进行检查:$ qpdf --check hello.pdf
WARNING: hello.pdf: file is damaged
WARNING: hello.pdf: can't find startxref
WARNING: hello.pdf: Attempting to reconstruct cross-reference table
hello.pdf: unable to find trailer dictionary while recovering damaged file
我在哪里做错了?
提前感谢任何回答,谢谢!