[latex3-commits] [git/LaTeX3-latex3-pdfresources] textfields: storing test text fields (162493f)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sun Mar 28 16:52:31 CEST 2021
Repository : https://github.com/latex3/pdfresources
On branch : textfields
Link : https://github.com/latex3/pdfresources/commit/162493ff80999d690f64a94ae5875532b0f1ac05
>---------------------------------------------------------------
commit 162493ff80999d690f64a94ae5875532b0f1ac05
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun Mar 28 16:52:31 2021 +0200
storing test text fields
>---------------------------------------------------------------
162493ff80999d690f64a94ae5875532b0f1ac05
experiments/testfield1.tex | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/experiments/testfield1.tex b/experiments/testfield1.tex
index af4e472..ae893a4 100644
--- a/experiments/testfield1.tex
+++ b/experiments/testfield1.tex
@@ -8,7 +8,7 @@
\ExplSyntaxOn
\pdfdict_new:n {l__pdffield/text/field}
\pdfdict_put:nnn {l__pdffield/text/field}{FT}{/Tx}
-
+%\bitset_set_true:Nn \l__pdffield_Ff_bitset {RichText}
\cs_new_protected:Npn \__pdffield_text_field_new:n #1
{
\group_begin:
@@ -26,7 +26,7 @@
% V,DV ??
%DA?
\pdfdict_put:nnx {l__pdffield/text/field}{V}{(blub?)}
- \pdfdict_put:nnx {l__pdffield/text/field}{DA}{(/F\__pdffield_fontname:\c_space_tl 10\c_space_tl Tf~1~0~0~rg)}
+ \pdfdict_put:nnx {l__pdffield/text/field}{DA}{(/F\__pdffield_fontname:\c_space_tl 10\c_space_tl Tf~1~0~1~rg ~1~0~1~RG)}
\pdfdict_put:nnx {l__pdffield/text/field}
{Kids}
{
@@ -60,11 +60,14 @@
\pdffield_store_appearance:nn {text/default}
{ {\color_select:n{green}\rule{4cm}{1cm}} }
-
+\pdffield_store_appearance:nn {text/rollover}
+ { {\color_select:n{blue}\rule{4cm}{1cm}} }
+\pdffield_store_appearance:nn {text/down}
+ { {\color_select:n{yellow}\rule{4cm}{1cm}} }
\cs_new_protected:Npn \__pdffield_text_annot_add:nnnn #1 #2 #3 #4 %name, wd, ht, dp,
{
\group_begin:
- \pdfdict_put:nnx {l__pdffield/text/annot}{AP}{<<\pdfdict_use:n{l__pdffield/text/annot/AP}>>}
+ %\pdfdict_put:nnx {l__pdffield/text/annot}{AP}{<<\pdfdict_use:n{l__pdffield/text/annot/AP}>>}
\pdfmeta_standard_verify:nF
{annot_flags}
{
@@ -149,8 +152,16 @@
}
},
appearance .initial:n = text/default,
+ align .choice:,
+ align / left .code:n = \pdfdict_put:nnn { l__pdffield/text/field }{Q}{0},
+ align / center .code:n = \pdfdict_put:nnn { l__pdffield/text/field }{Q}{1},
+ align / right .code:n = \pdfdict_put:nnn { l__pdffield/text/field }{Q}{2},
+ align .initial:n = left
}
+
+%down and rollover seems not to be used ...
+
\keys_define:nn { pdffield / text }
{
,width .tl_set:N = \l__pdffield_annot_wd_tl
@@ -210,10 +221,10 @@
%\iftutex
\setmainfont{Times New Roman} %works
%\setsansfont{comicsansms} %works
-%\setsansfont{comicsansms}
+\setsansfont{comicsansms}
%\setmainfont{calibri} % doesn't work /CIDFontType2
%\setsansfont{dejavusans} % doesn't work /CIDFontType2 texlive
-\setsansfont{NotoSans}
+%\setsansfont{NotoSans}
\fi
%\usepackage{helvet}
%\usepackage{times}
@@ -224,22 +235,26 @@
\ExplSyntaxOn
%\sffamily
-
+\bitset_set_true:Nn \l__pdffield_F_bitset {Print}
+%\pdfdict_put:nnn {l__pdffield/text/annot}{Border}{[1~1~1]}
+%\pdfdict_put:nnn {l__pdffield/text/annot}{C}{[1~0~0]}
%\sffamily
\pdfmanagement_add:nnx{Catalog/AcroForm}{DA}{(/F\__pdffield_fontname:\c_space_tl 10\c_space_tl Tf~1~0~0~rg)}
\pdfmanagement_add:nxx{Catalog/AcroForm/DR/Font}{F\__pdffield_fontname:}{\__pdffield_fontobjnum:\c_space_tl0 \c_space_tl R}
%\sffamily
-\font\test=phvr8r\test
+%\font\test=phvr8r\test
\pdfmanagement_add:nxx{Catalog/AcroForm/DR/Font}{F\__pdffield_fontname:}{\__pdffield_fontobjnum:\c_space_tl0 \c_space_tl R}
\par
%\sffamily
-zzz \__pdffield_text_add:n {name=blub2,width=4cm,height=15pt}
+zzz \__pdffield_text_add:n {name=blub2,width=4cm,height=15pt,align=center}
\par
\rmfamily
+\pdfdict_put:nnn {l__pdffield/text/annot}{MK}{<</BC[1~0~0]/BG[1~1~1]>>}
+\pdfdict_put:nnn {l__pdffield/text/annot}{BS}{<</W~1 /S/S>>}
zzz\__pdffield_text_add:n {name=blub1,width=4cm,height=15pt}
%\sffamily
More information about the latex3-commits
mailing list.