我刚刚发现Adobe 论坛:规范中的简单文本字符串示例已损坏。,所以我对查找纯文本源代码 PDF 示例产生了兴趣。
所以,通过那个帖子,我最终发现:
PDF 1.7 规范在第 699 页附录“_Annex 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
我哪里错了?
非常感谢您的任何答案,
干杯!