我刚发现帖子
Adobe Forums: Simple Text String Example in specification broken.,所以我有兴趣找到纯文本源代码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
我哪里错了?
非常感谢任何答案,
干杯!