为什么我的PDF创建过程的最后一部分失败了。 请参阅下面的 ps2pdf 命令的输出。 这是我自己开发的工具链的末端。 我从Matlab收集图像,使用LaTeX将它们拼接在一起,然后使用latexmk创建最终的PDF。
到目前为止,当有问题的文档增加到 3356 页时,这一直工作得很好!
文件output.ps 中的文件位置238282(如 ghostscript 错误输出中所述)位于"SDict begin [ {Catalog} <</PageLabels<>1<>2"行的末尾。 此行长度为 51542 个字符,描述了所有 3356 页。
现在这条线的长度是不是太长了? 如果我将.tex文件修剪到 3000 页并重新运行 latexmk,它就可以完成。
单独运行 ps2pdf 以显示错误。 从latexmk运行时出现相同的错误:
C:temp>c:MiKTeXmiktexbinps2pdf.exe output.ps output.pdf > error.txt 2>&1
给出的输出:
Error: /limitcheck in --string--
Operand stack:
--nostringval-- --nostringval-- --dict:1/1(L)-- PUT --nostringval-- 2 --nostringval-- 2 false --nostringval-- --nostringval-- (]) --nostringval-- --nostringval-- (3327) --nostringval-- --nostringval-- P 1 .pdfcvstring (<<n/P (3225)n>> 3226 <<n/P (32) (<<n/Nums [0 <<n/P (1)n>> 1 <<n/P (1)n>> 2 <<n/P (2)n>> 3 <<n/P (3)n>> 4 <<n/P (4)n>> 5 <<n/P (5)n>> 6 <<n/P (6)n>> 7 <<n/P (7)n>> 8 <<n/P (8)n>> 9 <<n/P (9)n>> 10 <<n/P (10)n>> 11 <<n/P (11)n>> 12 <<n...) 65550
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1917 4 5 %oparray_pop --nostringval-- 3 1 2 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --dict:1/1(L)-- --nostringval-- 1 %dict_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --dict:1/1(L)-- --nostringval-- 1 %dict_continue --nostringval-- --nostringval-- %zwritecvp_continue 1 %s_proc_write_continue --nostringval-- --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1159/1684(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)-- --dict:188/300(L)-- --dict:36/200(L)-- --dict:10/10(G)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 238282
MiKTeX GPL Ghostscript 9.00: Unrecoverable error, exit code 1
编辑:从进入 ps2pdf 的后记文件中添加了我的完整页面标签行。 请参阅粘贴条目 http://pastebin.com/FFvZpaRY
我运行了您提供的 pdfmark 9.10 的 pdfwrite 设备,没有错误,但 9.00 失败并显示与您显示的消息相同。
- Ghostscript 已扩展以支持 Postscript 字符串和数组具有>64k 条目的对象。
更新:假设您需要的页面标签是 1,1,2,3...3261(不知道为什么,但这就是您的示例中的内容),添加自动递增的数字标签比添加字符串前缀更简单。
[{Catalog}<<
/PageLabels<</Nums[0<</S/D>>1<</S/D>>]>>
>> /PUT pdfmark
或者,如果需要前缀,请将您的大数组拆分为两个或更多:
[/_objdef{leaf1}/type/dict/OBJ pdfmark
[/_objdef{leaf2}/type/dict/OBJ pdfmark
[{leaf1}<</Limits[0 3000]
/Nums[
... 0 to 3000 labels go here ...
>>/PUT pdfmark
[{leaf2}<</Limits[3001 3261]
/Nums[
... 3001 to 3261 labels go here ...
>>/PUT pdfmark
[{Catalog}<</PageLabels<</Kids[{leaf1} {leaf2}]>>
>>/PUT pdfmark
这两种解决方案都适用于 9.00