XeConTeXt bug report III: Wrong hyperlink
Hi, Hans and Jin-Hwan: When using ConTeXt to produce my documents, I found that all hyperlinks are wrong. And here is a simple test. The tex and pdf files are attached in the mail. The problem will happen when: 1) using pdftex to produce the dvi, and use dvipdfmx to convert the dvi to pdf. 2) using xetex to produce xdv, and xdvipdfmx that xdv to pdf. Open the file in Acrobat Reader, Go to page three, and you can see a hyperlink text "Equation 1", it links to page 2. however, the equation is in page1. The "section 1" or "page 4" should point to page 4, but it point to page 5 now. So my question: - As far as I know, dvipdfmx's ConTeXt support was written by Jin-Hwan. and the hyperlink code is written by Hans. Surely at least one of the two source code files has a cross-ref bug. But I don't know which. Can the bug be fixed? Thanks Yue Wang
On May 12, 2009, at 2:00 PM, Yue Wang wrote:
Hi, Hans and Jin-Hwan:
When using ConTeXt to produce my documents, I found that all hyperlinks are wrong. And here is a simple test.
The tex and pdf files are attached in the mail. The problem will happen when: 1) using pdftex to produce the dvi, and use dvipdfmx to convert the dvi to pdf. 2) using xetex to produce xdv, and xdvipdfmx that xdv to pdf.
Open the file in Acrobat Reader, Go to page three, and you can see a hyperlink text "Equation 1", it links to page 2. however, the equation is in page1.
The "section 1" or "page 4" should point to page 4, but it point to page 5 now.
So my question: - As far as I know, dvipdfmx's ConTeXt support was written by Jin-Hwan. and the hyperlink code is written by Hans. Surely at least one of the two source code files has a cross-ref bug. But I don't know which. Can the bug be fixed?
"/XYZ left top zoom" displays the page designated by page, with the coordinates (left, top) positioned at the upper-left corner of the window and
It's not a BUG in a strict sense. The driver file spec-dpx.tex (included in texlive 2008) just give \special{pdf:names /Dests (#1) [@thispage \PDFpageviewwrd]} in the 463th line for \doPDFdestination. However, \PDFpageviewwrd is defined in the 1666th line of spec-fdf.tex. Here, generated is "/XYZ 0 0 0". PDF Reference 1.7 (p.582) says that the contents of
the page magnified by the factor zoom.
So "/XYZ 0 0 0" means that the coordinates (0,0) of the page will be positioned at the upper-left corner of the window. But what is (0,0)? It is not the upper-left corner of the page, but the lower-left corner of the page. Therefore, it looks the next page is displayed. Hans already gave a comment at the 1656th line of spec-fdf.tex as
\def\PDFpagexyzspec{0 0 0} % hack, pdftex does handle this
I think that the value of the paperheight is better than 0 for "top" value. Best regards, ChoF.
Jin-Hwan Cho wrote:
I think that the value of the paperheight is better than 0 for "top" value.
thanks for figuring it out ... i now just fall back to fit Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, May 12, 2009 at 8:49 PM, Hans Hagen
Jin-Hwan Cho wrote:
I think that the value of the paperheight is better than 0 for "top" value.
thanks for figuring it out ... i now just fall back to fit
then focus=standard wont make the link point to the right place... btw, in ConTeXt's pdftex or luatex mode, it also point to the wrong place. but Eplain and LaTeX hyperref handle that right...
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Yue Wang wrote:
On Tue, May 12, 2009 at 8:49 PM, Hans Hagen
wrote: Jin-Hwan Cho wrote:
I think that the value of the paperheight is better than 0 for "top" value. thanks for figuring it out ... i now just fall back to fit
then focus=standard wont make the link point to the right place...
well, so be it .. i have no time now to look into xyz placement
btw, in ConTeXt's pdftex or luatex mode, it also point to the wrong place. but Eplain and LaTeX hyperref handle that right...
as Chof pointed out, it also relates a bit to how the viewer shows the page i tested the fixes for pdftex/xetex and it seems to work ok now Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
oh, no. better change that to this:
/XYZ @xpos @ypos 0
so xetex and pdftex/luatex will share the same behavior. (it point to
the place a little bit lower, so the behavior is much better than fit)
as to the wrong destination.. I highly suspect that the PDF /Dests is
written right after the box, not before the box.
On Wed, May 13, 2009 at 1:37 AM, Hans Hagen
Yue Wang wrote:
On Tue, May 12, 2009 at 8:49 PM, Hans Hagen
wrote: Jin-Hwan Cho wrote:
I think that the value of the paperheight is better than 0 for "top" value.
thanks for figuring it out ... i now just fall back to fit
then focus=standard wont make the link point to the right place...
well, so be it .. i have no time now to look into xyz placement
btw, in ConTeXt's pdftex or luatex mode, it also point to the wrong place. but Eplain and LaTeX hyperref handle that right...
as Chof pointed out, it also relates a bit to how the viewer shows the page
i tested the fixes for pdftex/xetex and it seems to work ok now
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Jin-Hwan Cho
-
Yue Wang