[pdftex] \pdfstartlink/\pdfextension startlink and QuadPoints

Ross Moore ross.moore at mq.edu.au
Fri Apr 19 00:36:14 CEST 2019


Hi Karl, Joseph,

On 19 Apr 2019, at 7:32 am, Karl Berry <karl at freefriends.org<mailto:karl at freefriends.org>> wrote:

QuadPoints

Speaking for myself, I've never heard of it. Thanh?


Here’s what the PDF Spec says:


QuadPoints    array    (Optional; PDF 1.6)

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be activated.
The coordinates for each quadrilateral are given in the order    x1 y1 x2 y2 x3 y3 x4 y4
specifying the four vertices of the quadrilateral in counterclockwise order.

For orientation purposes, such as when applying an underline border style, the bottom of a quadrilateral is the line formed by (x1, y1) and (x2, y2).

If this entry is not present or the conforming reader does not recognize it, the region specified by the Rect entry should be used.
QuadPoints  shall be ignored if any coordinate in the array lies outside the region specified by Rect.




FWIW, I see it mentioned wrt hyperref here, as you may well already know:
https://tex.stackexchange.com/questions/237063/hyperref-box-does-not-obey-slant

     We patch hyperref to also include the /QuadPoints [...] entry into the LinkPDF annotation.

Yes, this does exactly what is needed:

\makeatletter
 %patch hyperref
 \let\Hy at setpdfborderOrig\Hy at setpdfborder
 \def\Hy at setpdfborder{%
  \QuadPoints
  \Hy at setpdfborderOrig
 }
 \def\QuadPoints{}
\makeatother

given a method to correctly construct the key-value pair for  \QuadPoints .

This is done using Tikz , which is what is being used for the particular diagram under discussion.

For breaking hyperlinks across line-endings, some alternative coding would be needed,
perhaps with commands from  zref-savepos.sty  which cause exact coordinates to be
written into an auxiliary file, for use on the next run.
See the  pdfcomment  package, for some usage of   \zsavepos .



Best,
Karl


Hope this helps.

Ross

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/pdftex/attachments/20190418/9012e57b/attachment.html>


More information about the pdftex mailing list