【发布时间】:2012-06-11 12:27:49
【问题描述】:
我刚刚找到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
我在哪里做错了?
非常感谢您的任何回答,
干杯!
【问题讨论】:
标签: linux pdf command-line pdf-generation