[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: more form fields (5de54f4)

Ulrike Fischer fischer at troubleshooting-tex.de
Fri Sep 6 18:41:05 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/5de54f497c0d292d17613a020804b753d6c874f0

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

commit 5de54f497c0d292d17613a020804b753d6c874f0
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Fri Sep 6 18:41:05 2019 +0200

    more form fields


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

5de54f497c0d292d17613a020804b753d6c874f0
 hgeneric-experimental.def | 66 ++++++++++++++++++++++++++++-------------------
 pdfresources.dtx          | 12 ++++++++-
 2 files changed, 50 insertions(+), 28 deletions(-)

diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index 15f1ee7..2536ea9 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -1693,6 +1693,7 @@
   \Fld at additionalactions
 }
 \ExplSyntaxOn
+% Does an appeareance dict make sense here?
 \def\PDFForm at Text
   {
     /Subtype/Widget
@@ -1703,33 +1704,44 @@
     ~\Fld at flags
     /Q~\Fld at align
     /BS<</W~\Fld at borderwidth\c_space_tl /S /\Fld at borderstyle>>
-   \ifcase0\ifnum\Fld at rotation=\z@   \else 1\fi
-           \ifx\Fld at bordercolor\relax\else 1\fi
-           \ifx\Fld at bcolor\relax     \else 1\fi
-           \c_space_tl
-   \else
-     /MK<<%
-      \ifnum\Fld at rotation=\z@
-      \else
-        /R~\Fld at rotation
-      \fi
-      \ifx\Fld at bordercolor\relax
-      \else
-        /BC[\Fld at bordercolor]%
-      \fi
-      \ifx\Fld at bcolor\relax
-      \else
-        /BG[\Fld at bcolor]%
-      \fi
-    >>%
-  \fi
-  /DA(/Helv~\strip at pt\Fld at charsize\c_space_tl Tf%
-      \ifx\Fld at color\@empty\else\c_space_tl\Fld at color\fi)%
-  /DV(\Hy at escapestring{\Fld at default})%
-  /V(\Hy at escapestring{\Fld at value})%
-  \Fld at additionalactions
-  \ifnum\Fld at maxlen>\z@/MaxLen~\Fld at maxlen \fi
-}
+   \bool_if:nT
+     {
+        !\int_compare_p:nNn {\Fld at rotation} = {0}
+       ||
+        \tl_if_exist_p:N \Fld at bordercolor
+       ||
+        \tl_if_exist_p:N \Fld at bcolor
+     }
+     {
+       /MK
+         <<
+           \int_compare:nNnF {\Fld at rotation} = {0}
+             {
+               /R~\Fld at rotation
+             }
+           \tl_if_exist:NT \Fld at bordercolor
+             {
+               /BC[\Fld at bordercolor]
+             }
+           \tl_if_exist:NT \Fld at bcolor
+             {
+               /BG[\Fld at bcolor]
+             }
+        >>
+     }
+   /DA
+     (
+       /Helv~\strip at pt\Fld at charsize\c_space_tl Tf
+       \tl_if_empty:NF {\c_space_tl\Fld at color}
+     )
+   /DV(\Hy at escapestring{\Fld at default})
+   /V(\Hy at escapestring{\Fld at value})
+   ~\Fld at additionalactions
+   \int_compare:nNnT { \Fld at maxlen}>{0}
+     {
+       /MaxLen~\Fld at maxlen
+     }
+  }
 \ExplSyntaxOff
 \def\PDFForm at Submit{%
   /Subtype/Widget%
diff --git a/pdfresources.dtx b/pdfresources.dtx
index d6a9184..0b6699f 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -337,7 +337,12 @@
 % \end{macro}
 %
 % \subsection{references to page objects}
-% \begin{function}[added = 2019-08-18]
+% \begin{NOTE}{UF}
+% a reference to the current page would be useful, but difficult to
+% abstract in a sensible way. With xetex it is simply @thispage, but the other
+% engines are unclear.
+% \end{NOTE}
+% \begin{function}[EXP, added = 2019-08-18]
 %   {\pdf_pageobject_ref:n}
 %   \begin{syntax}
 %     \cs{pdf_pageobject_ref:n} \Arg{number}
@@ -382,6 +387,11 @@
   }
 
 \cs_new:Npn \pdf_pageobject_ref:n #1 { \@@_backend_pageobject_ref:n { #1 }}
+
+\cs_new_protected:Npn \pdf_thispageobject_ref:N #1
+ {
+
+ }
 %
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list