[latex3-commits] [git/LaTeX3-latex3-pdfresources] test-new-hooks: example for widget annotation (0ddd26e)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed May 13 19:06:28 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : test-new-hooks
Link : https://github.com/latex3/pdfresources/commit/0ddd26ee0207200ece5335c453c2e41f4c3fd5fa
>---------------------------------------------------------------
commit 0ddd26ee0207200ece5335c453c2e41f4c3fd5fa
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed May 13 19:06:28 2020 +0200
example for widget annotation
>---------------------------------------------------------------
0ddd26ee0207200ece5335c453c2e41f4c3fd5fa
experiments/buttonfield-test.tex | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/experiments/buttonfield-test.tex b/experiments/buttonfield-test.tex
new file mode 100644
index 0000000..68b7d2c
--- /dev/null
+++ b/experiments/buttonfield-test.tex
@@ -0,0 +1,29 @@
+\documentclass{article}
+\usepackage{pdfresources}
+\pagestyle{empty}
+%based/translated from https://chat.stackexchange.com/transcript/message/54366708#54366708
+\ExplSyntaxOn
+
+\pdf_uncompress:
+
+\pdfdict_new:n {annot/Widget}
+\pdfdict_put:nnn {annot/Widget}{Subtype}{/Widget}
+
+\NewDocumentCommand \buttonfield { }
+ {
+ \group_begin:
+ \pdfdict_put:nnn{annot/Widget}{F}{/Btn}
+ \pdfdict_put:nnn{annot/Widget}{T}{(button)}
+ \pdfdict_put:nnn{annot/Widget}{Ft}{65536}
+ \pdfannot_box:nnnnn {Widget}{ 100pt } { 100pt } { 0pt }{}
+ \pdfdict_gput:nnx {Catalog/AcroForm}{Fields}{\pdfannot_box_last:}
+ \group_end:
+ }
+
+\ExplSyntaxOff
+
+\begin{document}
+
+xxx\buttonfield
+
+\end{document}
\ No newline at end of file
More information about the latex3-commits
mailing list.