[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: improved link attribute handling of hyperref (145b4f9)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Apr 14 21:56:56 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : renamedict77
Link       : https://github.com/latex3/pdfresources/commit/145b4f99b14c74c434dda1ebe10de0d44f30249a

>---------------------------------------------------------------

commit 145b4f99b14c74c434dda1ebe10de0d44f30249a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Apr 14 21:56:56 2020 +0200

    improved link attribute handling of hyperref


>---------------------------------------------------------------

145b4f99b14c74c434dda1ebe10de0d44f30249a
 hgeneric-experimental.def        |  21 +++++++++++++++++--
 pdfresources.dtx                 |  19 +++++++++++++++++
 testfiles-dvips/ismap.tpf        | Bin 4715 -> 4785 bytes
 testfiles-dvips/linkhook.pvt     |   4 ++--
 testfiles-dvips/pdffilelink.tpf  | Bin 4589 -> 4628 bytes
 testfiles/ismap.luatex.tpf       |  38 ++++++++++++++++-----------------
 testfiles/ismap.tpf              |  30 +++++++++++++-------------
 testfiles/ismap.xetex.tpf        |  44 +++++++++++++++++++--------------------
 testfiles/ocgcolorlinks.pvt      |   3 ++-
 testfiles/pdffilelink.luatex.tpf |  32 ++++++++++++++--------------
 testfiles/pdffilelink.tpf        |  25 +++++++++++-----------
 testfiles/pdffilelink.xetex.tpf  |  40 +++++++++++++++++------------------
 12 files changed, 148 insertions(+), 108 deletions(-)

diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index 490dfa5..e278030 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -143,8 +143,8 @@
 \Hy at setbreaklinks{true}        %also for dvips??
 
 % checked dvips, luatex, xetex, dvipdfm: values are identical:
-\providecommand*\@pdfborder{0~0~1}
-\providecommand*\@pdfborderstyle{}
+%\providecommand*\@pdfborder{0~0~1}
+%\providecommand*\@pdfborderstyle{}
 % unicode ...
 \HyPsd at LoadUnicode
 \Hy at unicodetrue
@@ -802,6 +802,7 @@
   {
      \kvsetkeys{Hyp}{#1} %for now
      \keys_set:nn { hyp / setup }{ #1 }
+     \hypupdateattribute
   }
 % for now unknown keys should only give warnings.
 \keys_define:nn { hyp / setup }
@@ -1331,7 +1332,23 @@
    ,pdfwindowui    .default:n = true
  }
 
+\keys_define:nn { hyp / setup }
+  {
+    ,pdfborder  .code:n =
+      {
+        \tl_set:Nn \@pdfborder {#1}
+      }
+    ,pdfborder .initial:n = {0~0~1},
+    ,pdfborderstyle .code:n =
+      {
+        \tl_set:Nn \@pdfborderstyle {#1}
+      }
+    ,pdfborderstyle .initial:n = {},
+    ,colorlinks .meta:n = {pdfborder={0~0~0},pdfborderstyle={}}
+    ,ocgcolorlinks .meta:n = {pdfborder={0~0~0},pdfborderstyle={}}
+  }
 
+\hypupdateattribute
 
 \cs_set_protected:Npn \PDF at SetupDoc
   {
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 52307c4..d46f71a 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2108,6 +2108,25 @@
   }
 %    \end{macrocode}
 % \end{macro}
+%
+% \subsection{Local dictonaries}
+%
+% All dictionaries described above were global dictionaries and basically they
+% are written at most once (or at most once per page) to the PDF. The pdfdict module
+% predefines also a number of local dictionaries. These are used in objects like
+% link annotations (see the pdfannot module) which are written in varying
+% numbers to the PDF and allow to set their features and change them locally
+% if needed. The predefined dictionaries are
+%
+% \begin{tabular}{lp{6cm}}
+%  \multicolumn{2}{l}{annotation related: here are
+%                     \texttt{Border} and \texttt{C} (color)}\\
+%  annot/Link/Goto   & used in GoTo links (internal references) \\
+%  annot/Link/URI    & used in URI links (external uri references) \\
+%  annot/Link/GotoR  & used in GoToR links (file  references) \\
+%  annot/Link/Named  & used in Named actions (menu calls) \\
+%  annot/Link/Launch & used in Launch links (application calls) \\
+% \end{tabular}
 % \section{Various PDF contents}
 % The following commands allow to create a number of important pdf objects and contents in a
 % backend independant way.
diff --git a/testfiles-dvips/ismap.tpf b/testfiles-dvips/ismap.tpf
index f2679df..7cb44d8 100644
Binary files a/testfiles-dvips/ismap.tpf and b/testfiles-dvips/ismap.tpf differ
diff --git a/testfiles-dvips/linkhook.pvt b/testfiles-dvips/linkhook.pvt
index 45a74b6..1bcbc18 100644
--- a/testfiles-dvips/linkhook.pvt
+++ b/testfiles-dvips/linkhook.pvt
@@ -25,7 +25,7 @@
 \ExplSyntaxOn\makeatletter
 \hook_put_left:nnn
  { pdf }
- { annot_link_URI_begin }
+ { annot/Link/URI_begin }
  {
   begin~url
  }
@@ -36,7 +36,7 @@
 
 \hook_put_right:nnn
  { pdf }
- { annot_link_URI_end }
+ { annot/Link/URI_end }
  {
    end~url
  }
diff --git a/testfiles-dvips/pdffilelink.tpf b/testfiles-dvips/pdffilelink.tpf
index 8c73364..23931b0 100644
Binary files a/testfiles-dvips/pdffilelink.tpf and b/testfiles-dvips/pdffilelink.tpf differ
diff --git a/testfiles/ismap.luatex.tpf b/testfiles/ismap.luatex.tpf
index 3d0957e..94dad00 100644
--- a/testfiles/ismap.luatex.tpf
+++ b/testfiles/ismap.luatex.tpf
@@ -18,12 +18,12 @@ endobj
 [ 6 0 R 7 0 R ]
 endobj
 6 0 obj
-<< /Type /Annot /Rect [ 147.716 706.129 176.01 712.415 ]
+<< /Type /Annot /Border [0 0 1] /H /I /C [0 1 1]  /Rect [ 147.716 706.129 176.01 712.415 ]
  /Subtype/Link/A<</Type/Action /S/URI /URI(https://www.latex-project.org#abc~xyz) /IsMap true>>
  >>
 endobj
 7 0 obj
-<< /Type /Annot /Rect [ 147.716 694.174 176.01 700.46 ]
+<< /Type /Annot /Border [0 0 1] /H /I /C [0 1 1]  /Rect [ 147.716 694.174 176.01 700.46 ]
  /Subtype/Link/A<</Type/Action /S/URI /URI(https://www.latex-project.org#abc~xyz) >>
  >>
 endobj
@@ -117,26 +117,26 @@ xref
 0000000000 00000 f 
 0000000246 00000 n 
 0000000407 00000 n 
-0000000579 00000 n 
-0000000860 00000 n 
+0000000613 00000 n 
+0000000928 00000 n 
 0000000020 00000 n 
-0000000739 00000 n 
-0000000799 00000 n 
-0000002905 00000 n 
-0000003259 00000 n 
+0000000807 00000 n 
+0000000867 00000 n 
+0000002973 00000 n 
+0000003327 00000 n 
 0000000375 00000 n 
-0000000929 00000 n 
-0000001903 00000 n 
-0000000972 00000 n 
-0000001047 00000 n 
-0000002139 00000 n 
-0000003059 00000 n 
-0000003320 00000 n 
-0000003421 00000 n 
-0000003457 00000 n 
-0000003601 00000 n 
+0000000997 00000 n 
+0000001971 00000 n 
+0000001040 00000 n 
+0000001115 00000 n 
+0000002207 00000 n 
+0000003127 00000 n 
+0000003388 00000 n 
+0000003489 00000 n 
+0000003525 00000 n 
+0000003669 00000 n 
 trailer
 << /Size 25 /Root 23 0 R /Info 24 0 R >>
 startxref
-3757
+3825
 %%EOF
diff --git a/testfiles/ismap.tpf b/testfiles/ismap.tpf
index 8d10eda..45636dd 100644
--- a/testfiles/ismap.tpf
+++ b/testfiles/ismap.tpf
@@ -23,6 +23,7 @@ endobj
 6 0 obj
 <<
 /Type /Annot
+/Border [0 0 1] /H /I /C [0 1 1] 
 /Rect [147.716 706.129 175.999 712.411]
 /Subtype/Link/A<</Type/Action /S/URI /URI(https://www.latex-project.org#abc~xyz) /IsMap true>>
 >>
@@ -30,6 +31,7 @@ endobj
 7 0 obj
 <<
 /Type /Annot
+/Border [0 0 1] /H /I /C [0 1 1] 
 /Rect [147.716 694.174 175.999 700.456]
 /Subtype/Link/A<</Type/Action /S/URI /URI(https://www.latex-project.org#abc~xyz) >>
 >>
@@ -130,25 +132,25 @@ xref
 0000000000 00000 f 
 0000000177 00000 n 
 0000000313 00000 n 
-0000000482 00000 n 
-0000000757 00000 n 
-0000000015 00000 n 
-0000000640 00000 n 
-0000000698 00000 n 
-0000009213 00000 n 
-0000009353 00000 n 
+0000000516 00000 n 
 0000000825 00000 n 
-0000001232 00000 n 
-0000008992 00000 n 
-0000009411 00000 n 
-0000009508 00000 n 
-0000009544 00000 n 
-0000009688 00000 n 
+0000000015 00000 n 
+0000000708 00000 n 
+0000000766 00000 n 
+0000009281 00000 n 
+0000009421 00000 n 
+0000000893 00000 n 
+0000001300 00000 n 
+0000009060 00000 n 
+0000009479 00000 n 
+0000009576 00000 n 
+0000009612 00000 n 
+0000009756 00000 n 
 trailer
 << /Size 21
 /Root 19 0 R
 /Info 20 0 R
  >>
 startxref
-9844
+9912
 %%EOF
diff --git a/testfiles/ismap.xetex.tpf b/testfiles/ismap.xetex.tpf
index cb1c8e2..a4e7a1b 100644
--- a/testfiles/ismap.xetex.tpf
+++ b/testfiles/ismap.xetex.tpf
@@ -1,11 +1,11 @@
 %PDF-1.5
 %äðíø
 6 0 obj
-<</Type/Annot/Subtype/Link/A<</Type/Action/S/URI/URI(https://www.latex-project.org#abc~xyz)/IsMap
+<</Type/Annot/Border[0 0 1]/H/I/C[0 1 1]/Subtype/Link/A<</Type/Action/S/URI/URI(https://www.latex-project.org#abc~xyz)/IsMap
 true>>/Rect[147.716 703.24 176.01 719.349]>>
 endobj
 7 0 obj
-<</Type/Annot/Subtype/Link/A<</Type/Action/S/URI/URI(https://www.latex-project.org#abc~xyz)>>/Rect[147.716
+<</Type/Annot/Border[0 0 1]/H/I/C[0 1 1]/Subtype/Link/A<</Type/Action/S/URI/URI(https://www.latex-project.org#abc~xyz)>>/Rect[147.716
 691.285 176.01 707.394]>>
 endobj
 8 0 obj
@@ -97,29 +97,29 @@ endobj
 xref
 0 21
 0000000000 65535 f 
-0000001130 00000 n 
-0000001039 00000 n 
-0000000869 00000 n 
-0000002568 00000 n 
-0000003018 00000 n 
+0000001184 00000 n 
+0000001093 00000 n 
+0000000923 00000 n 
+0000002622 00000 n 
+0000003072 00000 n 
 0000000015 00000 n 
-0000000173 00000 n 
-0000000321 00000 n 
-0000000573 00000 n 
-0000000711 00000 n 
-0000000758 00000 n 
-0000000651 00000 n 
-0000000805 00000 n 
-0000000959 00000 n 
-0000000839 00000 n 
-0000001232 00000 n 
-0000002757 00000 n 
-0000001652 00000 n 
-0000002470 00000 n 
-0000002504 00000 n 
+0000000200 00000 n 
+0000000375 00000 n 
+0000000627 00000 n 
+0000000765 00000 n 
+0000000812 00000 n 
+0000000705 00000 n 
+0000000859 00000 n 
+0000001013 00000 n 
+0000000893 00000 n 
+0000001286 00000 n 
+0000002811 00000 n 
+0000001706 00000 n 
+0000002524 00000 n 
+0000002558 00000 n 
 trailer
 <</Root 1 0 R/Info 2 0 R/ID[<ID-STRING><ID-STRING>]/Size
 21>>
 startxref
-3167
+3221
 %%EOF
diff --git a/testfiles/ocgcolorlinks.pvt b/testfiles/ocgcolorlinks.pvt
index 943c5e1..4cf9c75 100644
--- a/testfiles/ocgcolorlinks.pvt
+++ b/testfiles/ocgcolorlinks.pvt
@@ -20,7 +20,8 @@
 \end{tabular}
 
 \section{hyperref colors / border }
-\makeatletter\def\@pdfborder{1 1 1} \def\HyColor at UseColor#1{}\makeatother
+\makeatletter \def\HyColor at UseColor#1{}\makeatother
+\hypersetup{pdfborder={1 1 1}}
 
 \begin{tabular}{lll}
  default color                    & example   \\\hline\\
diff --git a/testfiles/pdffilelink.luatex.tpf b/testfiles/pdffilelink.luatex.tpf
index ea0ee1c..6d1ddeb 100644
--- a/testfiles/pdffilelink.luatex.tpf
+++ b/testfiles/pdffilelink.luatex.tpf
@@ -17,7 +17,7 @@ endobj
 [ 6 0 R ]
 endobj
 6 0 obj
-<< /Type /Annot /Rect [ 147.716 704.196 164.115 715.145 ]
+<< /Type /Annot /Border [0 0 1] /H /I /C [0 .5 .5]  /Rect [ 147.716 704.196 164.115 715.145 ]
  /Subtype/Link/A<</F(blub.pdf)/S/GoToR/D(destination)>>
  >>
 endobj
@@ -113,25 +113,25 @@ xref
 0000000000 00000 f 
 0000000190 00000 n 
 0000000345 00000 n 
-0000000598 00000 n 
+0000000634 00000 n 
 0000000020 00000 n 
-0000000478 00000 n 
-0000000537 00000 n 
-0000002874 00000 n 
-0000003228 00000 n 
+0000000514 00000 n 
+0000000573 00000 n 
+0000002910 00000 n 
+0000003264 00000 n 
 0000000319 00000 n 
-0000000667 00000 n 
-0000001844 00000 n 
-0000000731 00000 n 
-0000000802 00000 n 
-0000002080 00000 n 
-0000003028 00000 n 
-0000003289 00000 n 
-0000003389 00000 n 
+0000000703 00000 n 
+0000001880 00000 n 
+0000000767 00000 n 
+0000000838 00000 n 
+0000002116 00000 n 
+0000003064 00000 n 
+0000003325 00000 n 
 0000003425 00000 n 
-0000003569 00000 n 
+0000003461 00000 n 
+0000003605 00000 n 
 trailer
 << /Size 24 /Root 22 0 R /Info 23 0 R >>
 startxref
-3725
+3761
 %%EOF
diff --git a/testfiles/pdffilelink.tpf b/testfiles/pdffilelink.tpf
index a178912..b308ceb 100644
--- a/testfiles/pdffilelink.tpf
+++ b/testfiles/pdffilelink.tpf
@@ -23,6 +23,7 @@ endobj
 6 0 obj
 <<
 /Type /Annot
+/Border [0 0 1] /H /I /C [0 .5 .5] 
 /Rect [147.716 704.192 164.099 715.04]
 /Subtype/Link/A<</F(blub.pdf)/S/GoToR/D(destination)>>
 >>
@@ -123,24 +124,24 @@ xref
 0000000000 00000 f 
 0000000154 00000 n 
 0000000284 00000 n 
-0000000528 00000 n 
+0000000564 00000 n 
 0000000015 00000 n 
-0000000412 00000 n 
-0000000469 00000 n 
-0000010845 00000 n 
-0000010985 00000 n 
-0000000596 00000 n 
-0000000955 00000 n 
-0000010620 00000 n 
-0000011043 00000 n 
-0000011139 00000 n 
+0000000448 00000 n 
+0000000505 00000 n 
+0000010881 00000 n 
+0000011021 00000 n 
+0000000632 00000 n 
+0000000991 00000 n 
+0000010656 00000 n 
+0000011079 00000 n 
 0000011175 00000 n 
-0000011319 00000 n 
+0000011211 00000 n 
+0000011355 00000 n 
 trailer
 << /Size 20
 /Root 18 0 R
 /Info 19 0 R
  >>
 startxref
-11475
+11511
 %%EOF
diff --git a/testfiles/pdffilelink.xetex.tpf b/testfiles/pdffilelink.xetex.tpf
index 53af088..2c4770c 100644
--- a/testfiles/pdffilelink.xetex.tpf
+++ b/testfiles/pdffilelink.xetex.tpf
@@ -1,7 +1,7 @@
 %PDF-1.5
 %äðíø
 6 0 obj
-<</Type/Annot/Subtype/Link/A<</F(blub.pdf)/S/GoToR/D(destination)>>/Rect[147.716
+<</Type/Annot/Border[0 0 1]/H/I/C[0 .5 .5]/Subtype/Link/A<</F(blub.pdf)/S/GoToR/D(destination)>>/Rect[147.716
 703.24 164.115 719.349]>>
 endobj
 7 0 obj
@@ -95,28 +95,28 @@ endobj
 xref
 0 20
 0000000000 65535 f 
-0000000872 00000 n 
-0000000781 00000 n 
-0000000611 00000 n 
-0000002533 00000 n 
-0000002983 00000 n 
+0000000901 00000 n 
+0000000810 00000 n 
+0000000640 00000 n 
+0000002562 00000 n 
+0000003012 00000 n 
 0000000015 00000 n 
-0000000137 00000 n 
-0000000323 00000 n 
-0000000460 00000 n 
-0000000506 00000 n 
-0000000401 00000 n 
-0000000553 00000 n 
-0000000701 00000 n 
-0000000587 00000 n 
-0000000974 00000 n 
-0000002722 00000 n 
-0000001422 00000 n 
-0000002426 00000 n 
-0000002473 00000 n 
+0000000166 00000 n 
+0000000352 00000 n 
+0000000489 00000 n 
+0000000535 00000 n 
+0000000430 00000 n 
+0000000582 00000 n 
+0000000730 00000 n 
+0000000616 00000 n 
+0000001003 00000 n 
+0000002751 00000 n 
+0000001451 00000 n 
+0000002455 00000 n 
+0000002502 00000 n 
 trailer
 <</Root 1 0 R/Info 2 0 R/ID[<ID-STRING><ID-STRING>]/Size
 20>>
 startxref
-3132
+3161
 %%EOF





More information about the latex3-commits mailing list.