【发布时间】:2020-12-02 00:11:37
【问题描述】:
我正在开发一个生成 PDF 文件的程序。我的示例代码使用外部参照流生成了一个增量更新的 PDF。 Adobe Reader 似乎认为这个简单的 PDF 文件存在一些问题。然而,像 poppler 和 chrome 这样的其他 PDF 阅读器对此没有任何问题。有人可以帮我解决这个问题吗?
文件如下,或者你可以在https://github.com/monstervia/pdfsign/blob/main/sample-update.pdf下载
%PDF-1.6
%âãÏÓ
1 0 obj
<</Type/Catalog/Pages 2 0 R>>
endobj
2 0 obj
<</Type/Pages/Kids[3 0 R]/Count 1>>
endobj
3 0 obj
<</Type/Page/Parent 2 0 R/Resources<<>>/MediaBox[0 0 612 792]>>
endobj
xref
0 4
0000000000 65535 f
0000000015 00000 n
0000000060 00000 n
0000000111 00000 n
trailer<</Size 4/Root 1 0 R>>
startxref
190
%%EOF
6 0 obj
<</Type/ObjStm/N 2/First 9/Length 235>>
stream
2 0 5 36
<</Type/Pages/Kids[5 0 R]/Count 1>>
<</Type/Page/MediaBox[0 0 612 792]/Contents 4 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F1<</Type/Font/Subtype/Type1/Name/F1/BaseFont/Helvetica/Encoding/WinAnsiEncoding>>>>>>/Parent 2 0 R>>
endstream
endobj
4 0 obj
<</Length 41>>
stream
BT /F1 15 Tf 72 720 Td (First Page) Tj ET
endstream
endobj
7 0 obj
<</Size 8/Prev 190/Root 1 0 R/ID[<52095740c7264561f0689d47606e10e2><52095740c7264561f0689d47606e10e2>]/Type/XRef/W[1 2 2]/Filter/ASCIIHexDecode/Index[0 1 2 6]/Length 106>>
stream
00 00 03 FF FF
02 00 06 00 00
00 00 00 00 01
01 02 7D 00 00
02 00 06 00 01
01 01 49 00 00
01 02 D6 00 00
>
endstream
endobj
startxref
726
%%EOF
【问题讨论】:
-
Adobe Reader 期望带有交叉引用表(或混合交叉引用)的 pdf 文件通过交叉引用表(或混合交叉引用)而不是纯粹的交叉引用流进行增量更新。
-
另请参阅 this answer 中的 Leonard Rosenthol 报价。
标签: pdf pdf-generation