summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty
blob: 1db8745a81d171d245e580f4006640642c8c19a4 (plain)
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
%%
%% This is file `sdapspdf.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% sdapspdf.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2015 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
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{sdapspdf}
    [2015/04/10 v0.1 Initial version of SDAPS pdf package]
\RequirePackage{expl3}[2011/08/23]
\ExplSyntaxOn
\ExplSyntaxOff

\RequirePackage{sdapsbase}
\RequirePackage{hyperref}

\ExplSyntaxOn

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\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


\endinput
%%
%% End of file `sdapspdf.sty'.