[texhax] HyperTeX tags
Oleg Katsitadze
olegkat at gmail.com
Sat Feb 25 10:12:49 CET 2006
> http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf
Thanks, Philip and Victor! This is exactly what I needed.
On Fri, Feb 24, 2006 at 09:15:57AM -0500, Victor Ivrii wrote:
> Both in the web browser (Safari with Adobe pdf plug-in) and AR 7.07
> detect no links in the file.
Sorry, I messed up. I put the special for the anchor in
to.tex but never used it, so I guess ghostscript just
ignored the unused anchor.
However, when I changed to.tex to include a reference to the
anchor, I discovered that the anchor was again ignored by
ps2pdf. What ps2pdf seems to have done is to convert my
link to the anchor into a link to the page. to.pdf contains
this code:
<</Type/Annot
/T(page.2)
/Rect [72 757 229 769]
/Border [1 1 1[]]
/C [0 0 1]
/Dest [10 0 R /FitH 841]
/Subtype/Link>>endobj
and here 10 0 R is the page on which the anchor is:
<< /Type /Pages /Kids [
4 0 R
10 0 R
] /Count 2
>>
Of course, the viewers cannot find the anchor in to.pdf.
I've read that dvipdfm also supports hypertex tags. So I've
tried to run
dvipdfm to.dvi
and now linking to to.pdf from from.pdf worked perfectly,
both in Xpdf and Acrobat Reader! to.pdf now properly
contains
<<
/Rect[71 756.92 230.16 767.78]
/Type/Annot
/Subtype/Link
/C[0 1 1]
/Dest(page.2)
>>
and
<<
/Limits[(page.2)(page.2)]
/Names[(page.2) 17 0 R]
>>
I guess the problem is actually in conversion from PS to PDF
by ghostscript (ps2pdf), because PS contains this code
HPSdict begin
/TargetAnchors
1 dict dup begin
(page.2) [2 [72 757 163 769] 841] def
end
and
TeXDict begin HPSdict begin 2 1 bop 0 166 a
Fa(Destination)55
b(in)h(to.p)5 b(df)0 5507 y(Reference)55
b(to)g(force)f(the)h(target)g
(anc)-5 b(hor)p
(#page.2) [[72 437 229 449] [1 1 1 [3 3]] [0 0 1]] pdfm
3858 11078 a(2)p eop end end
which I understand as both the anchor and the link being
there. I've uploaded the files to
http://geolsoft.freeshell.org/hypertex/
and to see the difference, try opening these links:
http://geolsoft.freeshell.org/hypertex/to.ps2pdf.pdf#page.2
http://geolsoft.freeshell.org/hypertex/to.dvipdfm.pdf#page.2
Does anyone have any idea why ghostscript discards the
anchor and how to make it use it? (Sorry, I should have
looked at the produced PDF and PS in the first place, this
would have saved all the trouble...)
> On Mac AR installs its plug-in in Safari only so other browsers use third-party
> plug-in which does not honor
No, I use native Adobe plug-in, but I think I've figured out
the problem. As soon as I load the page from the menu
Help -> About Plug-ins
PDF plug-in starts to work all of a sudden, i.e., Mozilla
starts opening PDFs inside the plug-in instead of spawning
separate Reader. I guess loading this page causes the
browser to somehow initialize its plug-in table. Sounds
like a bug in the Mozilla family browsers. Thanks anyway :).
> There was a discussion "reference to remote document" in pdftex where
> Heiko Oberdiek
> provided a lot of explanations. And referring to pdftex group I meant him
Thanks a lot for the tip!
> Well, I just reflect the light :-)
Keep on shining! (I've reasoned against "Shine on, you
crazy diamond!" :)
Thanks,
Oleg
More information about the texhax
mailing list