裁切框在 XeTeX 中不起作用

裁切框在 XeTeX 中不起作用

在此处输入图片描述这里我的需求是使用 xetex 创建 PDF 时设置裁切框,但生成的 PDF 没有裁切框。请提供解决方案来解决这个问题,这是我的 TeX 代码

梅威瑟:

\documentclass{book}
\usepackage{atbegshi}

% MediaBox can be fixed like so:
\makeatletter
\AtBeginShipout{\AtBeginShipoutAddToBox{
  \special{pdf:put @thispage <<
    /MediaBox [0 0 612.00000 792.00000]
  >>}
}}

% other boxes

\special{pdf:put @pages <<
  /BleedBox [81.0 63.0 531.0 729.0]
  /CropBox [0 0 612.00000 792.00000]
  /TrimBox [90.0 72.0 522.0 720.0]
>>}
\makeatother


\begin{document}
Between 200BC and 100BC, during the Han Dynasty, the Chinese used matrix-type methods with the text \textit{Nine chapters on the mathematical art}. There was further development, but it was not until 1683 when the idea of a determinant appeared in Japan when Seki wrote \textit{Method of solving the dissimulated problems}. This used matrix methods in tables in the same way as the earlier work of the Chinese. Ten years later the determinant first appeared in Europe in the work of Leibniz. The word determinant was first introduced by Gauss in 1801 while discussing quadratic forms, but Cauchy in 1812 used determinant in the modern sense.

Between 200BC and 100BC, during the Han Dynasty, the Chinese used matrix-type methods with the text \textit{Nine chapters on the mathematical art}. There was further development, but it was not until 1683 when the idea of a determinant appeared in Japan when Seki wrote \textit{Method of solving the dissimulated problems}. This used matrix methods in tables in the same way as the earlier work of the Chinese. Ten years later the determinant first appeared in Europe in the work of Leibniz. The word determinant was first introduced by Gauss in 1801 while discussing quadratic forms, but Cauchy in 1812 used determinant in the modern sense.
\end{document} 

答案1

根据 PDF 规范,只有媒体盒剪裁框是可继承的。

此外,默认值为剪裁框是价值媒体盒,因此您不必在您的案例中指定它。

这意味着,你应该把媒体盒进入@pages物体和出血框裁切框进入@thispage物体。

\documentclass{book}
\usepackage{lipsum}
\usepackage{atbegshi}

\special{pdf:put @pages <<
  /MediaBox [0 0 612.00000 792.00000]
>>}

\AtBeginShipout{%
  \AtBeginShipoutAddToBox{%
    \special{pdf:put @thispage <<
      /BleedBox [81.0 63.0 531.0 729.0]
      /TrimBox [90.0 72.0 522.0 720.0]
    >>}}}

\begin{document}
\lipsum[1]
\clearpage
\lipsum[2]
\end{document} 

相关内容