[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: working on version number (8900c96)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Apr 21 00:39:30 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/8900c96cff585fbbb135090f2d82a7ed03d7e7bd

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

commit 8900c96cff585fbbb135090f2d82a7ed03d7e7bd
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Apr 21 00:39:30 2019 +0200

    working on version number


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

8900c96cff585fbbb135090f2d82a7ed03d7e7bd
 hluatex-experimental.def |   63 ++++++++--------------------------------------
 memo.txt                 |    3 +++
 pdfresources.dtx         |    2 ++
 test-escapestring.tex    |   30 ++++++++++++++++++++++
 test-pdfresources.tex    |    7 ++++--
 5 files changed, 51 insertions(+), 54 deletions(-)

diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index 60e515d..3f23dea 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -12,6 +12,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % variants of hyperref commands to get attributes in the prop
 \RequirePackage{xparse}
+
 \ExplSyntaxOn
 %% messages, should later (with more drivers) go somewhere more generic ...
 \prop_gput:Nnn \g_msg_module_name_prop { hyp }{ hyperref }
@@ -227,55 +228,8 @@
     \HyPL at SetPageLabels
   }%
 \fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname pdf at escapestring\endcsname\relax
-  \begingroup
-    \catcode`\|=0 %
-    \@makeother\\%
-  |@firstofone{|endgroup
-    |def|Hy at pstringdef#1#2{%
-      |begingroup
-        |edef~{|string~}%
-        |xdef|Hy at gtemp{#2}%
-      |endgroup
-      |let#1|Hy at gtemp
-      |@onelevel at sanitize#1%
-      |edef#1{|expandafter|Hy at ExchangeBackslash#1\|@nil}%
-      |edef#1{|expandafter|Hy at ExchangeLeftParenthesis#1(|@nil}%
-      |edef#1{|expandafter|Hy at ExchangeRightParenthesis#1)|@nil}%
-    }%
-    |def|Hy at ExchangeBackslash#1\#2|@nil{%
-      #1%
-      |ifx|\#2|\%%
-      |else
-        \\%
-        |ltx at ReturnAfterFi{%
-          |Hy at ExchangeBackslash#2|@nil
-        }%
-      |fi
-    }%
-  }%
-  \def\Hy at ExchangeLeftParenthesis#1(#2\@nil{%
-    #1%
-    \ifx\\#2\\%
-    \else
-      \@backslashchar(%
-      \ltx at ReturnAfterFi{%
-        \Hy at ExchangeLeftParenthesis#2\@nil
-      }%
-    \fi
-  }%
-  \def\Hy at ExchangeRightParenthesis#1)#2\@nil{%
-    #1%
-    \ifx\\#2\\%
-    \else
-      \@backslashchar)%
-      \ltx at ReturnAfterFi{%
-        \Hy at ExchangeRightParenthesis#2\@nil
-      }%
-    \fi
-  }%
-\else
+%UF removed manual Hy at pstringdef definition, as \pdf at escapestring should be always defined
+%if needed a kernel command should be provided for other drivers ...
   \def\Hy at pstringdef#1#2{%
     \begingroup
       \edef~{\string~}%
@@ -283,7 +237,6 @@
     \endgroup
     \let#1\Hy at gtemp
   }%
-\fi
 \providecommand*{\XR at ext}{pdf}
 \Hy at setbreaklinks{true}
 \def\HyPat at ObjRef{%
@@ -340,7 +293,13 @@
       \Hy at temp@A\pdflastannot{annotation}%
       \Hy at temp@A\pdflastlink{link}%
       \ifx\Hy at temp\ltx at empty
-        \Hy at pdfminorversion=\Hy at pdfversion\relax
+       \int_compare:nNnTF { \Hy at pdfversion}  = {10 }
+        { %pdf 2.0, temporary solution
+          \pdf_version_gset:n {2.0}
+        }
+        {
+          \pdf_version_gset:n{1.\Hy at pdfversion}
+        }
       \else
         \let\Hy at temp@A\ltx at empty
         \ifnum\Hy at pdfversion=4 %
@@ -380,7 +339,7 @@
       :=\number\Hy at pdfversion\space
     }%
  }
-  \edef\Hy at pdfversion{\number\Hy at pdfminorversion}%
+  \edef\Hy at pdfversion{\driver_pdf_version_minor:}% XXXXXXXX = 10 for 2.0
 \ExplSyntaxOff
 \Hy at DisableOption{pdfversion}%
 
diff --git a/memo.txt b/memo.txt
new file mode 100644
index 0000000..aadf218
--- /dev/null
+++ b/memo.txt
@@ -0,0 +1,3 @@
+todo
+
+pdftexcmds -> \pdfescapestring/\pdf at escapestring in lua
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 7f95575..c5dea89 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -224,6 +224,8 @@
 
 \sys_if_engine_luatex:T
 {
+ %allow version 2.0 in luatex. Needs sorting out later.
+ \@namedef{Hy at pdfversion@2.0}{10}%
  \cs_new_protected:Nn \driver_pdf_catalog:n
  {
   \pdfextension catalog { #1 }
diff --git a/test-escapestring.tex b/test-escapestring.tex
new file mode 100644
index 0000000..1f8d15f
--- /dev/null
+++ b/test-escapestring.tex
@@ -0,0 +1,30 @@
+% !Mode:: "TeX:DE:UTF-8:Main"
+
+
+
+\documentclass{article}
+\usepackage{l3str-convert}
+\usepackage{hyperref}
+%\usepackage[T1]{fontenc}
+%don't compress pdf:
+\ExplSyntaxOn
+\driver_pdf_compresslevel:n {0}
+\driver_pdf_objects_disable:
+\cs_set_eq:NN\strsetconvert\str_set_convert:Nnnn
+\ExplSyntaxOff
+\begin{document}
+\makeatletter 
+\strsetconvert\test{abc \äöüß (}{}{iso88591/string}
+%\strsetconvert\test{abc Œ \äöüß (}{}{iso88591/string} %error
+\show\test
+
+\strsetconvert\test{abc \äöüß (}{}{utf8/string}
+\show\test
+
+
+\edef\test{\pdf at escapestring{\detokenize{abc Œ äöüß  (}}}
+\show\test
+
+\Hy at pstringdef\test{abc Œ äöüß  (}
+\show\test
+\end{document}
diff --git a/test-pdfresources.tex b/test-pdfresources.tex
index d1d377f..70fab8f 100644
--- a/test-pdfresources.tex
+++ b/test-pdfresources.tex
@@ -14,8 +14,10 @@
 \ExplSyntaxOff
 \usepackage{xcolor}
 
-
-\usepackage[customdriver=hluatex-experimental,ocgcolorlinks,]{hyperref}
+\makeatletter
+\@namedef{Hy at pdfversion@2.0}{10}%
+\makeatother%
+\usepackage[customdriver=hluatex-experimental,ocgcolorlinks,pdfversion=2.0]{hyperref}
 
 %%\tracingmacros=1
 \hypersetup{urlcolor=blue,linkbordercolor=blue,pdfborder={1 1 1},pdfprintpagerange=0}
@@ -24,6 +26,7 @@
 \makeatletter%\tracingmacros=1
 \textwidth=5cm
 \begin{document}
+\makeatletter%\show\Hy at pstringdef
 \ExplSyntaxOn
 
 \ifnum \driver_pdf_version_minor: = 5 XXXXXXXXX \else YYYYYYY\fi





More information about the latex3-commits mailing list