[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: small corrections for form fields (f9695b9)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Sep 5 00:59:44 CEST 2019


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

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

commit f9695b982328071d0178629603d5e223e9b4d910
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Sep 5 00:59:44 2019 +0200

    small corrections for form fields


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

f9695b982328071d0178629603d5e223e9b4d910
 .../{xform-tests.tex => attachfile-tests.tex}      | 33 +++++---------------
 experiments/check-duck.pdf                         |  2 +-
 hluatex-experimental.def                           | 35 +++++++++++++---------
 pdfresources.dtx                                   |  4 +--
 pdfstandard.tex                                    | 10 +++----
 5 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/experiments/xform-tests.tex b/experiments/attachfile-tests.tex
similarity index 87%
copy from experiments/xform-tests.tex
copy to experiments/attachfile-tests.tex
index bcc56be..71a83bc 100644
--- a/experiments/xform-tests.tex
+++ b/experiments/attachfile-tests.tex
@@ -1,37 +1,15 @@
 % !Mode:: "TeX:DE:UTF-8:Main"
 \documentclass{article}
 \usepackage{l3pdf,ifxetex,l3color}
-\usepackage%[patches] %doesn't work currently
-{pdfresources}
+\usepackage[patches]{pdfresources}
 \usepackage{tikz}
 \ExplSyntaxOn
 \pdf_uncompress:
 \ExplSyntaxOff
-%\usepackage[generic]
-%{attachfile2}
+\usepackage[generic]{attachfile2}
 
 \ExplSyntaxOn
 
-\bool_if:nT {\sys_if_engine_pdftex_p: && \sys_if_output_pdf_p: }
-{
-  %only for the test here
-  \cs_new:Npn \xxx_pdfresources: {\tex_the:D \tex_pdfpageresources:D}
-}
-
-%dvips????
-\bool_if:nT {\sys_if_engine_pdftex_p: && !\sys_if_output_pdf_p: }
-{
-}
-\sys_if_engine_luatex:T
-{
-   %only for the test here
-  \cs_new:Npn \xxx_pdfresources: {\tex_the:D \tex_pdfvariable:D pageresources}
-}
-
-\sys_if_engine_xetex:T
-{
- \cs_new:Npn \xxx_pdfresources: {/ExtGState~@pgfextgs} 
-}
 \ExplSyntaxOff
 \begin{document}
 \ExplSyntaxOn
@@ -67,14 +45,17 @@ E\pdf_xform_new:nnnn {FormB}{}{\xxx_pdfresources: /ABC /XYZ}
 G\pdf_xform_use:n{FormB}H
 
 \par\bigskip
-Appeareance\makebox[\pdf_xform_wd:n{FormB}][l]{\__pdf_backend_annotation:nnnn
+Appeareance
+ \makebox[\pdf_xform_wd:n{FormB}][l]
+  {\__pdf_backend_annotation:nnnn
     {\pdf_xform_wd:n{FormB}}
     {\pdf_xform_ht:n{FormB}}
     {\pdf_xform_dp:n{FormB}}
     {
      /Subtype /Stamp
      /AP << /N~\pdf_xform_ref:n{FormB} >>
-    }}xxx
+    }
+  }xxx
 \ExplSyntaxOff
 
 
diff --git a/experiments/check-duck.pdf b/experiments/check-duck.pdf
index 97b4538..0044593 100644
--- a/experiments/check-duck.pdf
+++ b/experiments/check-duck.pdf
@@ -1344,7 +1344,7 @@ trailer
 << /Size 82
 /Root 80 0 R
 /Info 81 0 R
-/ID [<D79E848A161C5C3D302BA9EA964BBAA8> <D79E848A161C5C3D302BA9EA964BBAA8>] >>
+/ID [<7CB7755420C365BFF5EBB865C17EFE5E> <7CB7755420C365BFF5EBB865C17EFE5E>] >>
 startxref
 49679
 %%EOF
diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index a8aae69..bf150cf 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -841,7 +841,7 @@
 \ExplSyntaxOn
 \def\MakeFieldObject#1#2
   {
-    \pdf_xform_new:nnnn { #2 }{}{} { #1 }
+    \pdf_xform_new:nnn { #2 }{} { #1 }
   }%
 
 \prop_new:N   \g__hyp_AcroForm_CoFields_prop
@@ -885,7 +885,8 @@
   {
     \exp_args:Nx\HyField@@AddToFields
       {
-        \pdf_link_last:
+        %\pdf_link_last:
+        \pdf_annotation_last:
       }
     \ifx\Fld at calculate@code\ltx at empty
     \else
@@ -901,7 +902,8 @@
                 \Fld at calculate@sortkey
                }
                {
-                 \pdf_link_last:
+                 %  \pdf_link_last:
+                 \pdf_annotation_last:
                }
             }
           \fi
@@ -1279,7 +1281,7 @@
   \def\Fld at name{#2}
   \def\Fld at default{0}
   \group_begin:
-    \def\Fld at width{\DefaultWidthofCheckBox}
+    \def\Fld at width {\DefaultWidthofCheckBox}
     \def\Fld at height{\DefaultHeightofCheckBox}
     \exp_args:No\HyField at SetKeys
      {
@@ -1287,16 +1289,21 @@
      }
     \PDFForm at Name
     \HyField at FlagsCheckBox
-    \ifFld at hidden\def\Fld at width{1sp}\fi
-    \LayoutCheckField{#2}{%
-      \mode_leave_vertical:
-      \HyAnn at AbsPageLabel
-      \Hy at escapeform\PDFForm at Check
-      \pdf_link_user:nnn
-       {widget} %perhaps we need more types
-       {\PDFForm at Check}
-       {\MakeCheckField{\Fld at width}{\Fld at height}}
-      \HyField at AddToFields
+    \legacy_if:nT { Fld at hidden }
+      {
+        \def\Fld at width{1sp}
+      }
+    \LayoutCheckField{#2}
+      {
+       \mode_leave_vertical:
+       \HyAnn at AbsPageLabel
+       \Hy at escapeform\PDFForm at Check
+       \pdf_annotation:nnnn
+         {\Fld at width}
+         {\Fld at height}
+         {0pt}
+         {\PDFForm at Check}
+       \HyField at AddToFields
     }
   \group_end:
 }
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 01a08e8..874486b 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2435,8 +2435,8 @@
     \pdf_catalog_gput:nx { OpenAction }{[\pdf_pageobject_ref:n {#1}~/#2]}
   }
 %    \end{macrocode}
-
-\subsection{Annotation}
+%
+%\subsection{Annotation}
 % \begin{function}[added = 2019-09-05]
 %   {\pdf_annotation:nnnn}
 %   \begin{syntax}
diff --git a/pdfstandard.tex b/pdfstandard.tex
index 0f2fd22..b8a0471 100644
--- a/pdfstandard.tex
+++ b/pdfstandard.tex
@@ -8,11 +8,11 @@
 %         draft (=>no links, no link colors),
 %         pdfpagemode=UseNone, % needed?
 %         bookmarks=false % needed? Already in draft?
-% pdf/A: pdfx hyperref options: pdfa, minorversion>=4
-%        hyperref: no ocgcolorlinks, minorversion>=4,
-%                  no launch (run) action, 
-%                  links with /F 4 flag
-%                  annotation Flags: invisible=false
+% pdf/A:  pdfx hyperref options: pdfa, minorversion>=4
+%         hyperref: no ocgcolorlinks, minorversion>=4,
+%                   no launch (run) action,
+%                   links with /F 4 flag
+%                   annotation Flags: invisible=false
 %                                    hidden=false
 %                                    nozoom=true
 %                                    norotate=true





More information about the latex3-commits mailing list