1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
% \iffalse meta-comment
%
% Copyright (C) 2014 by Henry Menke <henrimenke@gmail.com>
% Copyright (C) 2019 by Benjamin Berg <benjamin@sipsolutions.net>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Benjamin Berg.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{sdapspdf.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{sdapspdf}
%<*package>
[2015/04/10 v0.1 Initial version of SDAPS pdf package]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{sdapspdf}[2015/04/10]
%\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{sdapspdf.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{v0.1}{2015/01/14}{Initial version}
%
% \GetFileInfo{sdapspdf.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \title{The \textsf{sdapspdf} package\thanks{This document
% corresponds to \textsf{sdapspdf}~\fileversion, dated \filedate.}}
% \author{Benjamin Berg \\ \texttt{benjamin@sipsolutions.net}}
%
% \maketitle
%
% \section{Documentation}
%
% Please refer to \url{https://sdaps.org/class-doc} for documentation.
%
% \StopEventually{\PrintChanges\PrintIndex}
%
% \section{Implementation}
%
% This package uses the \LaTeX3 language internally, so we need to enable it.
% \begin{macrocode}
% We need at least 2011-08-23 for \keys_set_known:nnN
\RequirePackage{expl3}[2011/08/23]
%\RequirePackage{xparse}
\ExplSyntaxOn
% \end{macrocode}
%
% And we need a number of other packages.
% \begin{macrocode}
\ExplSyntaxOff
\RequirePackage{sdapsbase}
\RequirePackage{hyperref}
\ExplSyntaxOn
% \end{macrocode}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \subsection{PDF Support}
%
% This package adds basic overlays to SDAPS boxes so that they become editable.
% It is also possible to pre-fill them using overrides or the normal mechanism
% to set variables for box drawing.
%
% \begin{macrocode}
\bool_new:N \l__sdaps_pdf_form_bool
\bool_new:N \l__sdaps_pdf_checkbox_default_bool
\tl_new:N \l__sdaps_pdf_checkboxsymbol_tl
\keys_define:nn { sdaps / checkbox / overlay / pdfform }
{
pdf_form .bool_set:N = \l__sdaps_pdf_form_bool,
pdf_form .initial:n = false,
default .bool_set:N = \l__sdaps_pdf_checkbox_default_bool,
default .initial:n = false,
checkboxsymbol .tl_set:N = \l__sdaps_pdf_checkboxsymbol_tl,
checkboxsymbol .initial:n = 8,
}
\cs_new_protected_nopar:Nn \_sdaps_pdf_overlay_checkbox_form:
{
\keys_set_known:nV { sdaps / checkbox / overlay / pdfform } \l_sdaps_parse_unknown_tl %
\bool_if:NT \l__sdaps_pdf_form_bool {
\node[anchor=center,inner~sep=0pt,outer~sep=0pt] at ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5*(\l_sdaps_width_dim, -\l_sdaps_height_dim)$) {
\CheckBox[name=\l_sdaps_var_tl,bordersep=0,borderwidth=0pt,checkboxsymbol=\l__sdaps_pdf_checkboxsymbol_tl,bordercolor=,backgroundcolor=,checked=\bool_if:nTF\l__sdaps_pdf_checkbox_default_bool{true}{false},height=\l_sdaps_checkbox_height_dim,width=\l_sdaps_checkbox_width_dim]{\ignorespaces}
};
}
}
\seq_put_left:Nn \g__sdaps_checkbox_overlays_seq \_sdaps_pdf_overlay_checkbox_form:
\cs_new_protected_nopar:Nn \_sdaps_pdf_overlay_text_form:
{
\keys_set_known:nV { sdaps / checkbox / overlay / pdfform } \l_sdaps_parse_unknown_tl %
\bool_if:NT \l__sdaps_pdf_form_bool {
\node[anchor=center,inner~sep=2pt,outer~sep=0pt] at ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5*(\l_sdaps_width_dim, -\l_sdaps_height_dim)$) {
\dim_set:Nn \l_sdaps_width_dim { \l_sdaps_width_dim - 4pt }
\dim_set:Nn \l_sdaps_height_dim { \l_sdaps_height_dim - 4pt }
\TextField[name=\l_sdaps_var_tl,bordersep=0pt,borderwidth=0pt,bordercolor=,backgroundcolor=,multiline=true,height=\l_sdaps_height_dim,width=\l_sdaps_width_dim]{\ignorespaces}
};
}
}
\seq_put_left:Nn \g__sdaps_textbox_overlays_seq \_sdaps_pdf_overlay_text_form:
\ExplSyntaxOff
%
% \end{macrocode}
%
% \Finale
\endinput
|