[latex3-commits] [git/LaTeX3-latex3-pdfresources] test-new-hooks: more meta code (6fc6ab0)
Ulrike Fischer
fischer at troubleshooting-tex.de
Tue May 19 19:43:00 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : test-new-hooks
Link : https://github.com/latex3/pdfresources/commit/6fc6ab03f6468413501125b001073b7926175028
>---------------------------------------------------------------
commit 6fc6ab03f6468413501125b001073b7926175028
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Tue May 19 19:43:00 2020 +0200
more meta code
>---------------------------------------------------------------
6fc6ab03f6468413501125b001073b7926175028
hgeneric-experimental.def | 37 ++++++++++++++++---------------------
l3pdfmeta.dtx | 35 ++++++++++++++++++++++++++++++++---
2 files changed, 48 insertions(+), 24 deletions(-)
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index ccc3735..e40a060 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -1385,6 +1385,14 @@
,pdfwindowui .default:n = true
}
+% styles and colors.
+% this needs some sorting.
+% should colorlinks reset the border?
+% which colors should be used?
+% should we use the generic hooks or make hyp specific hooks?
+% what about font changes?
+% hooks are global, is this the right thing to use here?
+% perhaps the hook should only take a tl and this is filled?
\keys_define:nn { hyp / setup }
{
,pdfborder .code:n =
@@ -1653,23 +1661,10 @@
}
%%% UF removed setpagesize code, should be done by kernel/graphicx
-
-\def\Acrobatmenu#1#2
+%!! do we need a action dict type??
+\RenewDocumentCommand \Acrobatmenu { m m }
{
- \prop_get:NnNTF \g_pdfmeta_standard_prop {named_actions} \l_tmpa_tl
- {
- \tl_if_in:NnTF \l_tmpa_tl { #1 }
- {
- \bool_set_true:N \l__hyp_tmpa_bool %restricted but ok
- }
- {
- \bool_set_false:N \l__hyp_tmpa_bool %restricted not ok
- }
- }
- {
- \bool_set_true:N \l__hyp_tmpa_bool % no restrictions
- }
- \bool_if:NTF \l__hyp_tmpa_bool
+ \pdfmeta_if_named_action_allowed:nTF {#1}
{
\mode_leave_vertical:
\pdfannot_link:nnn { Named }
@@ -1694,13 +1689,13 @@
#2
}
}
-\ExplSyntaxOff
-%%% UF removed old atbegshi fix
-\ExplSyntaxOn
-\def\MakeFieldObject#1#2
+
+
+\NewDocumentCommand \MakeFieldObject { m m }
{
\pdf_xform_new:nnn { #2 }{} { #1 }
- }%
+ }
+
\prop_new:N \g__hyp_AcroForm_CoFields_prop
\prop_new:N \g__hyp_AcroForm_Fields_prop
diff --git a/l3pdfmeta.dtx b/l3pdfmeta.dtx
index 61d9994..2b6faf8 100644
--- a/l3pdfmeta.dtx
+++ b/l3pdfmeta.dtx
@@ -105,6 +105,7 @@
\msg_new:nnn {pdf}{unknown-standard}{The~standard~'#1'~is~unknown~and~has~been~ignored}
\bool_new:N \g_@@_meta_bool
+
\keys_define:nn { pdf / setup }
{
,pdfversion .code:n =
@@ -181,11 +182,39 @@
% \end{macrocode}
%
% \section{standards (work in progress)}
-% \subsection{pdf/A}
+% \subsection{Tools and tests}
+% This public property will contain the settings for the document.
% \begin{macrocode}
-
\prop_new:N \g_pdfmeta_standard_prop
-
+% \end{macrocode}
+% This conditional tests if the value for /N in a named action is allowed
+% (pdf/A restrict the names).
+% \begin{macrocode}
+\prg_new_protected_conditional:Npnn \pdfmeta_if_named_action_allowed:n #1 { F, T , TF }
+ {
+ \prop_get:NnNTF \g_pdfmeta_standard_prop {named_actions} \l_@@_tmpa_tl
+ {
+ \tl_if_in:NnTF \l_@@_tmpa_tl { #1 }
+ {
+ \prg_return_true: %restricted but ok
+ }
+ {
+ \prg_return_false: %restricted and false
+ }
+ }
+ {
+ \prg_return_true: %not restricted
+ }
+ }
+% \end{macrocode}
+% \begin{macrocode}
+\hook_gput_code:nnn {begindocument} {pdf}
+ {
+ \prop_item:Nn \g_pdfmeta_standard_prop { annot_flags }
+ }
+% \end{macrocode}
+% \subsection{pdf/A}
+% \begin{macrocode}
\prop_new:c { g_@@_meta_standard_pdf/A-1b_prop }
\prop_set_from_keyval:cn { g_@@_meta_standard_pdf/A-1b_prop }
{
More information about the latex3-commits
mailing list.