[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: textfields (059b37d)

Ulrike Fischer fischer at troubleshooting-tex.de
Fri Sep 6 13:21:28 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/059b37da13f9f57fd2a1b8e522baa8adbedd7139

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

commit 059b37da13f9f57fd2a1b8e522baa8adbedd7139
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Fri Sep 6 13:21:28 2019 +0200

    textfields


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

059b37da13f9f57fd2a1b8e522baa8adbedd7139
 .../{formfields.tex => formcheckboxfields.tex}     |  1 +
 experiments/formfields.tex                         |  1 +
 experiments/{formfields.tex => formtextfields.tex} | 53 +++++++++++---------
 hgeneric-experimental.def                          | 58 ++++++++++++----------
 4 files changed, 64 insertions(+), 49 deletions(-)

diff --git a/experiments/formfields.tex b/experiments/formcheckboxfields.tex
similarity index 98%
copy from experiments/formfields.tex
copy to experiments/formcheckboxfields.tex
index 1cddba0..fcac752 100644
--- a/experiments/formfields.tex
+++ b/experiments/formcheckboxfields.tex
@@ -33,6 +33,7 @@
 
 \begin{Form}[NeedAppearances=false]
 
+
 \LARGE\sffamily
 \CheckBox[name=check]{\makebox[4cm][l]{Check the mark!}}
 
diff --git a/experiments/formfields.tex b/experiments/formfields.tex
index 1cddba0..fcac752 100644
--- a/experiments/formfields.tex
+++ b/experiments/formfields.tex
@@ -33,6 +33,7 @@
 
 \begin{Form}[NeedAppearances=false]
 
+
 \LARGE\sffamily
 \CheckBox[name=check]{\makebox[4cm][l]{Check the mark!}}
 
diff --git a/experiments/formfields.tex b/experiments/formtextfields.tex
similarity index 59%
copy from experiments/formfields.tex
copy to experiments/formtextfields.tex
index 1cddba0..ff12cab 100644
--- a/experiments/formfields.tex
+++ b/experiments/formtextfields.tex
@@ -4,34 +4,39 @@
 \DeclareDocumentMetaData{uncompress}
 \documentclass{article}
 \usepackage[customdriver=hgeneric-experimental]{hyperref}
-\usepackage{xcolor,tikzducks,tikzlings,graphics}
+%\usepackage{xcolor,tikzducks,tikzlings,graphics}
 \begin{document}
-\ExplSyntaxOn
-\MakeFieldObject
-       {
-         \fbox{\tikz\duck;}
-       }
-       {xform_DuckCheckmark}
-\MakeFieldObject
-       {
-         \fbox{\tikz\bear;}
-       }
-       {xform_BearCheckmark}
+%\ExplSyntaxOn
+%\MakeFieldObject
+%       {
+%         \fbox{\tikz\duck;}
+%       }
+%       {xform_DuckCheckmark}
+%\MakeFieldObject
+%       {
+%         \fbox{\tikz\bear;}
+%       }
+%       {xform_BearCheckmark}
+%
+% \MakeFieldObject
+%       {
+%         \phantom{\tikz\duck;}
+%       }
+%       {xform_NoDuckCheckmark}
+% \MakeFieldObject
+%       {
+%         \phantom{\tikz\bear;}
+%       }
+%       {xform_NoBearCheckmark}
+%
+%\ExplSyntaxOff
 
- \MakeFieldObject
-       {
-         \phantom{\tikz\duck;}
-       }
-       {xform_NoDuckCheckmark}
- \MakeFieldObject
-       {
-         \phantom{\tikz\bear;}
-       }
-       {xform_NoBearCheckmark}
+\begin{Form}[NeedAppearances=false]
 
-\ExplSyntaxOff
+\TextField[name=text]{Insert Text}
 
-\begin{Form}[NeedAppearances=false]
+\end{Form}
+\end{document}
 
 \LARGE\sffamily
 \CheckBox[name=check]{\makebox[4cm][l]{Check the mark!}}
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index a64ddc0..15f1ee7 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -1084,12 +1084,17 @@
       \leavevmode
       \HyAnn at AbsPageLabel
       \Hy at escapeform\PDFForm at Text
-      \pdf_link_user:nnn
-       {widget} %perhaps we need more types??
-       {\PDFForm at Text}
-       {
-       \MakeTextField{\Fld at width}{\Fld at height}
-       }
+      \pdf_annotation:nnnn
+          {\Fld at width}
+          {\Fld at height}
+          {0pt} %is this correct?
+          {\PDFForm at Text}
+     % \pdf_link_user:nnn
+%       {widget} %perhaps we need more types??
+%       {\PDFForm at Text}
+%       {
+%       \MakeTextField{\Fld at width}{\Fld at height}
+%       }
       \HyField at AddToFields
     }%
   \endgroup
@@ -1687,24 +1692,26 @@
   \fi
   \Fld at additionalactions
 }
-\def\PDFForm at Text{%
-  /Subtype/Widget%
-  \Fld at annotflags
-  \Fld at pageobjref
-  \Fld at annotnames
-  /FT/Tx%
-  \Fld at flags
-  /Q \Fld at align
-  /BS<</W \Fld at borderwidth\space /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
-          \space
-  \else
-    /MK<<%
+\ExplSyntaxOn
+\def\PDFForm at Text
+  {
+    /Subtype/Widget
+    ~\Fld at annotflags
+    ~\Fld at pageobjref
+    ~\Fld at annotnames
+    /FT/Tx
+    ~\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
+        /R~\Fld at rotation
       \fi
       \ifx\Fld at bordercolor\relax
       \else
@@ -1716,13 +1723,14 @@
       \fi
     >>%
   \fi
-  /DA(/Helv \strip at pt\Fld at charsize\space Tf%
-      \ifx\Fld at color\@empty\else\space\Fld at color\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
+  \ifnum\Fld at maxlen>\z@/MaxLen~\Fld at maxlen \fi
 }
+\ExplSyntaxOff
 \def\PDFForm at Submit{%
   /Subtype/Widget%
   \Fld at annotflags





More information about the latex3-commits mailing list