Create a gist now

Instantly share code, notes, and snippets.

@zr-tex8r /image.tex
Last active Aug 29, 2015

What would you like to do?
LaTeX: What kind of bounding boxes do dvipdfmx use in including PDF image files?
% This is a pdfLaTeX document.
% The papersize is set to 250bp x 250bp, which will
% make the MediaBox equal [0 0 250 250].
% No compression; PDF version still might be 1.5.
% Enable or disable each of the following lines.
/BleedBox [0 0 200 200]
/CropBox [0 0 150 150]
/TrimBox [0 0 100 100]
/ArtBox [0 0 50 50]
\put( 0, 0){\makebox(0,0)[lb]{O}}
\put( 50, 50){\makebox(0,0)[rt]{A}}
% This is a plain TeX document containing a dvipdfmx special.
Here\vskip 100pt
% Include a PDF image without giving bbox values.
\special{pdf:epdf clip 1 width 100pt (image.pdf)}%
% This is a pdfLaTeX document.
% THe 'pagebox' option specifies which box should be used.

zr-tex8r commented Jun 21, 2014

pdflatex image.tex

(なお MediaBox の値は geometry で与えた用紙サイズの通りで 0 0 250 250 である。)


tex test.tex
dvipdfmx test.dvi

として得られる test.pdf を見ると、dvipdfmx がどの box を用いたか判断できる。

extractbb image.pdf

で extractbb がどの box を用いたかが判断できる。

※ちなみに、image.pdf を Adobe Reader や SumatraPDF 等で開くと、CropBox の中のみが表示される。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment