[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: booleans, starting pdf version (a008794)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sat Apr 20 01:00:36 CEST 2019
Repository : https://github.com/latex3/pdfresources
On branch : testlinkstuff
Link : https://github.com/latex3/pdfresources/commit/a00879490fd65fcca9ad8c4bf745653e1a25a0df
>---------------------------------------------------------------
commit a00879490fd65fcca9ad8c4bf745653e1a25a0df
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sat Apr 20 01:00:36 2019 +0200
booleans, starting pdf version
>---------------------------------------------------------------
a00879490fd65fcca9ad8c4bf745653e1a25a0df
hluatex-experimental.def | 38 ++++++++++++++++++++++++++++----------
test-pdfresources.tex | 6 +++++-
2 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index 41e92bb..60e515d 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -28,12 +28,23 @@
{\msg_error:nn {hyp}{missing-bookmark-package}}
}}
-% this need sorting out later. pdf standards should be handled outside the driver.
-% pdfa forces the flag /F 4 in some places.
+% booleans for the (some) option keys. As hyperref disables them it is okay to set them here, hypersetup
+% can't interfere
+%%% pdfa key:
\bool_new:N\l__hyp_pdfa_bool
\ifHy at pdfa
\bool_set_true:N \l__hyp_pdfa_bool
\fi
+
+%%% pdfversion
+\bool_new:N\l__hyp_setpdfversion_bool
+\ifHy at setpdfversion
+ \bool_set_true:N \l__hyp_setpdfversion_bool
+\fi
+
+
+% this need sorting out later. pdf standards should be handled outside the driver.
+% pdfa forces the flag /F 4 in some places.
\AtBeginDocument
{
\bool_if:NT \l__hyp_pdfa_bool
@@ -64,7 +75,7 @@
% the hooks for links from the hyperref keys.
\def\Hy at EXPsetpdfborder
{
- \clist_map_inline:nn { url , file , run , link, menu}
+ \clist_map_inline:nn { url , file , run , link, menu }
{
\tl_if_empty:NTF \@pdfborder
{
@@ -193,11 +204,13 @@
\ExplSyntaxOn
% catalog mapped to expl3 command
-\pdf at ifdraftmode{%
+\pdf at ifdraftmode
+ {
\let\Hy at PutCatalog \use_none:n
-}{%
+ }
+ {
\let\Hy at PutCatalog \driver_pdf_catalog:n
-}
+ }
\ExplSyntaxOff
@@ -277,10 +290,14 @@
[0-9]*[1-9][0-9]* 0 R%
}
-\edef\Hy at pdfminorversion{\pdfvariable minorversion}%
-\edef\Hy at pdfmajorversion{\pdfvariable majorversion}%
+
+%\edef\Hy at pdfminorversion{\pdfvariable minorversion}%
+%\edef\Hy at pdfmajorversion{\pdfvariable majorversion}%
\ExplSyntaxOn
+\cs_set_eq:NN \Hy at pdfminorversion \driver_pdf_version_minor:
+\cs_set_eq:NN \Hy at pdfmajorversion \driver_pdf_version_major:
+
\ifHy at ocgcolorlinks
\pdf_version_min_gset:n { 1.5 }
\fi
@@ -289,7 +306,8 @@
% or in the pdf level?
% set pdfversion / needs adaption to major version!!!
\ExplSyntaxOn
- \ifHy at setpdfversion
+\bool_if:NT\l__hyp_setpdfversion_bool
+ {
\ifnum\Hy at pdfversion<5 %
\ifHy at verbose
\Hy at InfoNoLine{%
@@ -361,7 +379,7 @@
\expandafter\string\Hy at pdfminorversion
:=\number\Hy at pdfversion\space
}%
- \fi
+ }
\edef\Hy at pdfversion{\number\Hy at pdfminorversion}%
\ExplSyntaxOff
\Hy at DisableOption{pdfversion}%
diff --git a/test-pdfresources.tex b/test-pdfresources.tex
index d554291..d1d377f 100644
--- a/test-pdfresources.tex
+++ b/test-pdfresources.tex
@@ -15,7 +15,7 @@
\usepackage{xcolor}
-\usepackage[customdriver=hluatex-experimental,ocgcolorlinks,pdfversion=1.5]{hyperref}
+\usepackage[customdriver=hluatex-experimental,ocgcolorlinks,]{hyperref}
%%\tracingmacros=1
\hypersetup{urlcolor=blue,linkbordercolor=blue,pdfborder={1 1 1},pdfprintpagerange=0}
@@ -25,6 +25,10 @@
\textwidth=5cm
\begin{document}
\ExplSyntaxOn
+
+\ifnum \driver_pdf_version_minor: = 5 XXXXXXXXX \else YYYYYYY\fi
+
+
\hook_put:nnnn
{ pdf }
{ startlink_url_attr }
More information about the latex3-commits
mailing list