我使用gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dFirstPage=$2 -dLastPage=$3 -sOUTPUTFILE=$4 $1
在脚本中使用 Ghostscript 9.07 从 pdf 文件中提取页面。我收到很多警告(如以下输出中的第一行所示)和一个错误:
GPL Ghostscript 9.07: **** Warning: Outline has invalid link that was discarded.
GPL Ghostscript 9.07: ERROR: A pdfmark destination page 4 points beyond the last page 3.
然而,生成的 pdf(由提取的页面组成)很好。我想知道为什么我收到此错误和警告,尽管我选择了选项 -q
对于 quiet
。我对此进行了一些搜索,发现例如 this ,但 pdf 文件已生成 hypertexnames=false
因此建议的解决方案不适用于我的情况(Ubuntu 13.04)。
补充一下:.pdf 文件是通过 pdflatex 生成的:
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{tikz}
\usepackage{hyperref}
\begin{document}
\tikz[remember picture, overlay]\node at (current page.south)[rectangle, fill, color=gray]{};
\clearpage
\section{foo}
\clearpage
\tableofcontents
\clearpage
\section{bar}
foo bar
\end{document}
最佳答案
原始文件包含命名目标(在本例中为大纲树),该目标指向一个编号页面,该页面不会出现在最终输出文件中(因为您尚未选择包含所有页面)。
因此,目标被省略,这就是您的输出文件起作用的原因,并且会生成一条警告,告诉您某些请求的目标将不存在。
pdfwrite 设备几乎忽略 -q 这类警告,因为我们认为它们很重要。
关于latex - Ghostscript 9.07 : Error: A pdfmark destimation . ..点超出最后一页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16252370/