[tex-live] xdvipdfmx: wrong annotation rectangle if the pstricks is involved

Hironobu Yamashita h.y.acetaminophen at gmail.com
Sun Sep 23 08:09:57 CEST 2018


Hi Ulrike,

It may be too late but I looked into this, and I guess
the issue is difficult to be perfectly solved by xdvipdfmx.

2018-03-06 23:17 Ulrike Fischer <news3 at nililand.de>:
>
> If one compile the following document with xelatex then the complete
> page is the link area. xdvipdfmx reports:
> xdvipdfmx:warning: Annotation out of page boundary.
> xdvipdfmx:warning: Current page's MediaBox: [0 0 612 792]
> xdvipdfmx:warning: Annotation: [0 0 2375.09 3357.41]
> xdvipdfmx:warning: Maybe incorrect paper size specified.

The below is my investigation.

(1) Saving the MWE as test.tex, compile

$ xelatex -no-pdf test
$ xdvipdfmx -vvvv test

shows

%====
Current input buffer is -->pdf:bann<</Type/Annot/Subtype/Link/Border[0
0 1]/H...<--

Current input buffer is -->pst:  tx at Dict begin STP newpath /ArrowA {
moveto }...<--
(Image:/var/folders/m8/j64xn09j2_xbqscws7skdbxc0000gn/T/dvipdfmx.tyivt6[/var/folders/m8/j64xn09j2_xbqscws7skdbxc0000gn/T/dvipdfmx.tyivt6][PDF],Page:1)
Current input buffer is -->pdf:eann<--

xdvipdfmx:warning: Annotation out of page boundary.
xdvipdfmx:warning: Current page's MediaBox: [0 0 612 792]
xdvipdfmx:warning: Annotation: [0 0 2375.09 3357.41]
xdvipdfmx:warning: Maybe incorrect paper size specified.
%====

>From the above log, there should be some temporary files involved.

(2) I could find four temporary files (attached), and the last-created one
(the above dvipdfmx.tyivt6) looked like a PDF generated by Ghostscript.
It contained /MediaBox [ 0 0 2384 3370 ]. It seems that these values
were used to calculate annotation rectangle.
(Note: 2375.09 = 2384*72/72.27, 3357.41 = 3370*72/72.27)

(3) Back to dvipdfmx.cfg, distiller parameters (passed to rungs) contain
-sPAPERSIZE=a0
which is the reason why GS has set /MediaBox [ 0 0 2384 3370 ].
I don't know how to create a PDF with tightly-cropped /MediaBox with GS.

(4) BTW, the annotation rectangle is sometimes wrong for EPS image
inclusion too. Note that the distiller parameter -dEPSCrop is effective
for EPS (it wins -sPAPERSIZE=a0), but the annotation rectangle is
always set to the /MediaBox of PDF without scaling.

%====
\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
%% wrong rectangle is set as if scale=1
\null\vskip500pt
\href{https://www.tug.org/texlive/}{\includegraphics[width=1cm]{tiger.eps}}
\clearpage
%% rectangle is correct for scale=1
\href{https://www.tug.org/texlive/}{\includegraphics{tiger.eps}}
\end{document}
%====

Hope this helps,
Hironobu Yamashita
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xdvipdfmx-tempfiles.zip
Type: application/zip
Size: 2788 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20180923/62e64f31/attachment.zip>


More information about the tex-live mailing list