xs/watermark.xs

filter: Statementstmt 54.2% 239 / 441 Branchbran 41.4% 207 / 500 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 47.4% 446 / 941 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/pdfmake_meta.c ↑ Summary src/pdfmake_pkcs12.c »
1 ##############################################################################
2 # Watermark XS bindings
3 ##############################################################################
4  
5 MODULE = PDF::Make PACKAGE = PDF::Make::Watermark
6 PROTOTYPES: ENABLE
7  
8 pdfmake_watermark_t *
9 text(class, text_sv, ...)
10 const char *class
11 SV *text_sv
12 PREINIT:
13 pdfmake_watermark_opts_t opts;
14 const char *text;
15 int i;
16 CODE:
17 PERL_UNUSED_VAR(class);
18 27 ▶ if (!SvOK(text_sv) || SvCUR(text_sv) == 0)
Branch: 2 branches
BranchTrueFalseTotal
if (!SvOK(text_sv) || SvCUR(text_sv) == 0) 26 1 27
if (!SvOK(text_sv) || SvCUR(text_sv) == 0) 1 25 26
19 2 croak("Text required");
20  
21 25 text = SvPV_nolen(text_sv);
22 25 ▶ if (!text || !*text)
Branch: 2 branches
BranchTrueFalseTotal
if (!text || !*text) 25 0 25
if (!text || !*text) 0 25 25
23 0 croak("Text required");
24  
25 25 pdfmake_watermark_opts_init(&opts);
26  
27 54 ▶ for (i = 2; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 2; i < items; i += 2) { 30 24 54
28 const char *key;
29 SV *val;
30 const char *pos;
31  
32 30 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 30 30
33 30 key = SvPV_nolen(ST(i));
34 30 val = ST(i + 1);
35  
36 30 ▶ if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "position")) { 20 10 30
37 20 ▶ if (!SvOK(val)) {
Branch: 1 branch
BranchTrueFalseTotal
if (!SvOK(val)) { 0 20 20
38 0 opts.position = PDFMAKE_WM_POS_CENTER;
39 20 ▶ } else if (SvIOK(val) || SvNOK(val)) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (SvIOK(val) || SvNOK(val)) { 19 1 20
} else if (SvIOK(val) || SvNOK(val)) { 0 19 19
40 1 opts.position = (pdfmake_wm_position_t)SvIV(val);
41 } else {
42 19 pos = SvPV_nolen(val);
43 19 ▶ if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER; 2 17 19
44 17 ▶ else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL; 3 14 17
45 14 ▶ else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE; 2 12 14
46 12 ▶ else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM; 1 11 12
47 11 ▶ else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT; 1 10 11
48 10 ▶ else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER; 1 9 10
49 9 ▶ else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT; 2 7 9
50 7 ▶ else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT; 2 5 7
51 5 ▶ else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER; 1 4 5
52 4 ▶ else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT; 1 3 4
53 3 ▶ else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER; 1 2 3
54 2 ▶ else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER; 1 1 2
55 1 else croak("Unknown position: %s", pos);
56 }
57 }
58 10 ▶ else if (strEQ(key, "opacity")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "opacity")) { 2 8 10
59 2 opts.opacity = SvNV(val);
60 }
61 8 ▶ else if (strEQ(key, "rotation")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "rotation")) { 1 7 8
62 1 opts.rotation = SvNV(val);
63 }
64 7 ▶ else if (strEQ(key, "scale")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "scale")) { 1 6 7
65 1 opts.scale = SvNV(val);
66 }
67 6 ▶ else if (strEQ(key, "x_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "x_offset")) { 0 6 6
68 0 opts.x_offset = SvNV(val);
69 }
70 6 ▶ else if (strEQ(key, "y_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "y_offset")) { 0 6 6
71 0 opts.y_offset = SvNV(val);
72 }
73 6 ▶ else if (strEQ(key, "overlay")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "overlay")) { 1 5 6
74 1 opts.as_overlay = SvIV(val);
75 }
76 5 ▶ else if (strEQ(key, "font")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "font")) { 1 4 5
77 1 opts.font_name = SvPV_nolen(val);
78 }
79 4 ▶ else if (strEQ(key, "size")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "size")) { 1 3 4
80 1 opts.font_size = SvNV(val);
81 }
82 3 ▶ else if (strEQ(key, "color")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "color")) { 1 2 3
83 1 ▶ if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 1 0 1
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 1 0 1
84 1 AV *av = (AV*)SvRV(val);
85 1 ▶ if (av_len(av) >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(av) >= 2) { 1 0 1
86 1 opts.color[0] = SvNV(*av_fetch(av, 0, 0));
87 1 opts.color[1] = SvNV(*av_fetch(av, 1, 0));
88 1 opts.color[2] = SvNV(*av_fetch(av, 2, 0));
89 }
90 }
91 }
92 2 ▶ else if (strEQ(key, "tile_spacing_x")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_x")) { 1 1 2
93 1 opts.tile_spacing_x = SvNV(val);
94 }
95 1 ▶ else if (strEQ(key, "tile_spacing_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_y")) { 1 0 1
96 1 opts.tile_spacing_y = SvNV(val);
97 }
98 }
99  
100 24 RETVAL = pdfmake_watermark_text(NULL, text, &opts);
101 24 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 24 24
102 0 croak("PDF::Make::Watermark: failed to create text watermark");
103 OUTPUT:
104 RETVAL
105  
106 pdfmake_watermark_t *
107 image(class, image_obj, ...)
108 const char *class
109 UV image_obj
110 PREINIT:
111 pdfmake_watermark_opts_t opts;
112 int i;
113 4 double width = 0.0;
114 4 double height = 0.0;
115 4 int have_width = 0;
116 4 int have_height = 0;
117 CODE:
118 PERL_UNUSED_VAR(class);
119 4 ▶ if (!image_obj)
Branch: 1 branch
BranchTrueFalseTotal
if (!image_obj) 1 3 4
120 1 croak("Image object required");
121  
122 3 pdfmake_watermark_opts_init(&opts);
123  
124 9 ▶ for (i = 2; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 2; i < items; i += 2) { 6 3 9
125 const char *key;
126 SV *val;
127 const char *pos;
128  
129 6 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 6 6
130 6 key = SvPV_nolen(ST(i));
131 6 val = ST(i + 1);
132  
133 6 ▶ if (strEQ(key, "width")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "width")) { 2 4 6
134 2 width = SvNV(val);
135 2 have_width = 1;
136 }
137 4 ▶ else if (strEQ(key, "height")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "height")) { 1 3 4
138 1 height = SvNV(val);
139 1 have_height = 1;
140 }
141 3 ▶ else if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "position")) { 1 2 3
142 1 ▶ if (!SvOK(val)) {
Branch: 1 branch
BranchTrueFalseTotal
if (!SvOK(val)) { 0 1 1
143 0 opts.position = PDFMAKE_WM_POS_CENTER;
144 1 ▶ } else if (SvIOK(val) || SvNOK(val)) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (SvIOK(val) || SvNOK(val)) { 1 0 1
} else if (SvIOK(val) || SvNOK(val)) { 0 1 1
145 0 opts.position = (pdfmake_wm_position_t)SvIV(val);
146 } else {
147 1 pos = SvPV_nolen(val);
148 1 ▶ if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER; 1 0 1
149 0 ▶ else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL; 0 0 0
150 0 ▶ else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE; 0 0 0
151 0 ▶ else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM; 0 0 0
152 0 ▶ else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT; 0 0 0
153 0 ▶ else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER; 0 0 0
154 0 ▶ else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT; 0 0 0
155 0 ▶ else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT; 0 0 0
156 0 ▶ else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER; 0 0 0
157 0 ▶ else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT; 0 0 0
158 0 ▶ else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER; 0 0 0
159 0 ▶ else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER; 0 0 0
160 0 else croak("Unknown position: %s", pos);
161 }
162 }
163 2 ▶ else if (strEQ(key, "opacity")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "opacity")) { 1 1 2
164 1 opts.opacity = SvNV(val);
165 }
166 1 ▶ else if (strEQ(key, "rotation")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "rotation")) { 0 1 1
167 0 opts.rotation = SvNV(val);
168 }
169 1 ▶ else if (strEQ(key, "scale")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "scale")) { 1 0 1
170 1 opts.scale = SvNV(val);
171 }
172 0 ▶ else if (strEQ(key, "x_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "x_offset")) { 0 0 0
173 0 opts.x_offset = SvNV(val);
174 }
175 0 ▶ else if (strEQ(key, "y_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "y_offset")) { 0 0 0
176 0 opts.y_offset = SvNV(val);
177 }
178 0 ▶ else if (strEQ(key, "overlay")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "overlay")) { 0 0 0
179 0 opts.as_overlay = SvIV(val);
180 }
181 0 ▶ else if (strEQ(key, "tile_spacing_x")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_x")) { 0 0 0
182 0 opts.tile_spacing_x = SvNV(val);
183 }
184 0 ▶ else if (strEQ(key, "tile_spacing_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_y")) { 0 0 0
185 0 opts.tile_spacing_y = SvNV(val);
186 }
187 }
188  
189 3 ▶ if (!have_width)
Branch: 1 branch
BranchTrueFalseTotal
if (!have_width) 1 2 3
190 1 croak("Width required for image watermark");
191 2 ▶ if (!have_height)
Branch: 1 branch
BranchTrueFalseTotal
if (!have_height) 1 1 2
192 1 croak("Height required for image watermark");
193  
194 1 RETVAL = pdfmake_watermark_image(NULL, (uint32_t)image_obj, width, height, &opts);
195 1 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 1 1
196 0 croak("PDF::Make::Watermark: failed to create image watermark");
197 OUTPUT:
198 RETVAL
199  
200 pdfmake_watermark_t *
201 _new_text(class, doc, text, ...)
202 const char *class
203 SV *doc
204 const char *text
205 PREINIT:
206 pdfmake_watermark_opts_t opts;
207 int i;
208 CODE:
209 PERL_UNUSED_VAR(doc);
210 PERL_UNUSED_VAR(class);
211 0 pdfmake_watermark_opts_init(&opts);
212
213 /* Parse optional hash arguments */
214 0 ▶ for (i = 3; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 3; i < items; i += 2) { 0 0 0
215 0 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 0 0
216 0 const char *key = SvPV_nolen(ST(i));
217 0 SV *val = ST(i + 1);
218
219 0 ▶ if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "position")) { 0 0 0
220 0 opts.position = (pdfmake_wm_position_t)SvIV(val);
221 }
222 0 ▶ else if (strEQ(key, "opacity")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "opacity")) { 0 0 0
223 0 opts.opacity = SvNV(val);
224 }
225 0 ▶ else if (strEQ(key, "rotation")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "rotation")) { 0 0 0
226 0 opts.rotation = SvNV(val);
227 }
228 0 ▶ else if (strEQ(key, "scale")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "scale")) { 0 0 0
229 0 opts.scale = SvNV(val);
230 }
231 0 ▶ else if (strEQ(key, "x_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "x_offset")) { 0 0 0
232 0 opts.x_offset = SvNV(val);
233 }
234 0 ▶ else if (strEQ(key, "y_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "y_offset")) { 0 0 0
235 0 opts.y_offset = SvNV(val);
236 }
237 0 ▶ else if (strEQ(key, "overlay")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "overlay")) { 0 0 0
238 0 opts.as_overlay = SvIV(val);
239 }
240 0 ▶ else if (strEQ(key, "font")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "font")) { 0 0 0
241 0 opts.font_name = SvPV_nolen(val);
242 }
243 0 ▶ else if (strEQ(key, "size")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "size")) { 0 0 0
244 0 opts.font_size = SvNV(val);
245 }
246 0 ▶ else if (strEQ(key, "color")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "color")) { 0 0 0
247 0 ▶ if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
248 0 AV *av = (AV*)SvRV(val);
249 0 ▶ if (av_len(av) >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(av) >= 2) { 0 0 0
250 0 opts.color[0] = SvNV(*av_fetch(av, 0, 0));
251 0 opts.color[1] = SvNV(*av_fetch(av, 1, 0));
252 0 opts.color[2] = SvNV(*av_fetch(av, 2, 0));
253 }
254 }
255 }
256 0 ▶ else if (strEQ(key, "tile_spacing_x")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_x")) { 0 0 0
257 0 opts.tile_spacing_x = SvNV(val);
258 }
259 0 ▶ else if (strEQ(key, "tile_spacing_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_y")) { 0 0 0
260 0 opts.tile_spacing_y = SvNV(val);
261 }
262 }
263
264 0 RETVAL = pdfmake_watermark_text(NULL, text, &opts);
265 0 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 0 0
266 0 croak("PDF::Make::Watermark: failed to create text watermark");
267 OUTPUT:
268 RETVAL
269  
270 pdfmake_watermark_t *
271 _new_image(class, doc, image_obj, width, height, ...)
272 const char *class
273 SV *doc
274 UV image_obj
275 double width
276 double height
277 PREINIT:
278 pdfmake_watermark_opts_t opts;
279 int i;
280 CODE:
281 PERL_UNUSED_VAR(doc);
282 PERL_UNUSED_VAR(class);
283 0 pdfmake_watermark_opts_init(&opts);
284
285 /* Parse optional hash arguments */
286 0 ▶ for (i = 5; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 5; i < items; i += 2) { 0 0 0
287 0 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 0 0
288 0 const char *key = SvPV_nolen(ST(i));
289 0 SV *val = ST(i + 1);
290
291 0 ▶ if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "position")) { 0 0 0
292 0 opts.position = (pdfmake_wm_position_t)SvIV(val);
293 }
294 0 ▶ else if (strEQ(key, "opacity")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "opacity")) { 0 0 0
295 0 opts.opacity = SvNV(val);
296 }
297 0 ▶ else if (strEQ(key, "rotation")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "rotation")) { 0 0 0
298 0 opts.rotation = SvNV(val);
299 }
300 0 ▶ else if (strEQ(key, "scale")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "scale")) { 0 0 0
301 0 opts.scale = SvNV(val);
302 }
303 0 ▶ else if (strEQ(key, "x_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "x_offset")) { 0 0 0
304 0 opts.x_offset = SvNV(val);
305 }
306 0 ▶ else if (strEQ(key, "y_offset")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "y_offset")) { 0 0 0
307 0 opts.y_offset = SvNV(val);
308 }
309 0 ▶ else if (strEQ(key, "overlay")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "overlay")) { 0 0 0
310 0 opts.as_overlay = SvIV(val);
311 }
312 0 ▶ else if (strEQ(key, "tile_spacing_x")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_x")) { 0 0 0
313 0 opts.tile_spacing_x = SvNV(val);
314 }
315 0 ▶ else if (strEQ(key, "tile_spacing_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "tile_spacing_y")) { 0 0 0
316 0 opts.tile_spacing_y = SvNV(val);
317 }
318 }
319
320 0 RETVAL = pdfmake_watermark_image(NULL, (uint32_t)image_obj, width, height, &opts);
321 0 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 0 0
322 0 croak("PDF::Make::Watermark: failed to create image watermark");
323 OUTPUT:
324 RETVAL
325  
326 void
327 DESTROY(self)
328 pdfmake_watermark_t *self
329 CODE:
330 25 pdfmake_watermark_free(self);
331  
332 const char *
333 type(self)
334 pdfmake_watermark_t *self
335 CODE:
336 2 ▶ RETVAL = (self->type == PDFMAKE_WM_TYPE_TEXT) ? "text" : "image";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (self->type == PDFMAKE_WM_TYPE_TEXT) ? "text" : "image"; 1 1 2
337 OUTPUT:
338 RETVAL
339  
340 const char *
341 text_content(self)
342 pdfmake_watermark_t *self
343 CODE:
344 1 ▶ if (self->type == PDFMAKE_WM_TYPE_TEXT)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_TYPE_TEXT) 1 0 1
345 1 ▶ RETVAL = self->data.text.text ? self->data.text.text : "";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->data.text.text ? self->data.text.text : ""; 1 0 1
346 else
347 0 RETVAL = "";
348 OUTPUT:
349 RETVAL
350  
351 int
352 position(self)
353 pdfmake_watermark_t *self
354 CODE:
355 7 ▶ RETVAL = self->opts.position;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.position; 0 7 7
356 OUTPUT:
357 RETVAL
358  
359 double
360 opacity(self)
361 pdfmake_watermark_t *self
362 CODE:
363 3 ▶ RETVAL = self->opts.opacity;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.opacity; 0 3 3
364 OUTPUT:
365 RETVAL
366  
367 double
368 rotation(self)
369 pdfmake_watermark_t *self
370 CODE:
371 1 ▶ RETVAL = self->opts.rotation;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.rotation; 0 1 1
372 OUTPUT:
373 RETVAL
374  
375 double
376 scale(self)
377 pdfmake_watermark_t *self
378 CODE:
379 2 ▶ RETVAL = self->opts.scale;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.scale; 0 2 2
380 OUTPUT:
381 RETVAL
382  
383 double
384 x_offset(self)
385 pdfmake_watermark_t *self
386 CODE:
387 0 ▶ RETVAL = self->opts.x_offset;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.x_offset; 0 0 0
388 OUTPUT:
389 RETVAL
390  
391 double
392 y_offset(self)
393 pdfmake_watermark_t *self
394 CODE:
395 0 ▶ RETVAL = self->opts.y_offset;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.y_offset; 0 0 0
396 OUTPUT:
397 RETVAL
398  
399 int
400 overlay(self)
401 pdfmake_watermark_t *self
402 CODE:
403 2 ▶ RETVAL = self->opts.as_overlay;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.as_overlay; 0 2 2
404 OUTPUT:
405 RETVAL
406  
407 const char *
408 font(self)
409 pdfmake_watermark_t *self
410 CODE:
411 2 ▶ RETVAL = self->opts.font_name ? self->opts.font_name : "Helvetica-Bold";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.font_name ? self->opts.font_name : "Helvetica-Bold"; 2 0 2
412 OUTPUT:
413 RETVAL
414  
415 double
416 size(self)
417 pdfmake_watermark_t *self
418 CODE:
419 2 ▶ RETVAL = self->opts.font_size;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.font_size; 0 2 2
420 OUTPUT:
421 RETVAL
422  
423 SV *
424 color(self)
425 pdfmake_watermark_t *self
426 PREINIT:
427 AV *av;
428 CODE:
429 1 av = newAV();
430 1 av_push(av, newSVnv(self->opts.color[0]));
431 1 av_push(av, newSVnv(self->opts.color[1]));
432 1 av_push(av, newSVnv(self->opts.color[2]));
433 1 RETVAL = newRV_noinc((SV*)av);
434 OUTPUT:
435 RETVAL
436  
437 double
438 width(self)
439 pdfmake_watermark_t *self
440 CODE:
441 1 ▶ if (self->type == PDFMAKE_WM_TYPE_IMAGE)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_TYPE_IMAGE) 1 0 1
442 1 RETVAL = self->data.image.width;
443 else
444 0 RETVAL = self->data.text.text_width;
445 OUTPUT:
446 RETVAL
447  
448 double
449 height(self)
450 pdfmake_watermark_t *self
451 CODE:
452 1 ▶ if (self->type == PDFMAKE_WM_TYPE_IMAGE)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_TYPE_IMAGE) 1 0 1
453 1 RETVAL = self->data.image.height;
454 else
455 0 RETVAL = self->data.text.text_height;
456 OUTPUT:
457 RETVAL
458  
459 double
460 tile_spacing_x(self)
461 pdfmake_watermark_t *self
462 CODE:
463 1 ▶ RETVAL = self->opts.tile_spacing_x;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.tile_spacing_x; 0 1 1
464 OUTPUT:
465 RETVAL
466  
467 double
468 tile_spacing_y(self)
469 pdfmake_watermark_t *self
470 CODE:
471 1 ▶ RETVAL = self->opts.tile_spacing_y;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.tile_spacing_y; 0 1 1
472 OUTPUT:
473 RETVAL
474  
475 UV
476 image_obj(self)
477 pdfmake_watermark_t *self
478 CODE:
479 1 ▶ if (self->type == PDFMAKE_WM_TYPE_IMAGE)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_TYPE_IMAGE) 1 0 1
480 1 RETVAL = (UV)self->data.image.image_obj;
481 else
482 0 RETVAL = 0;
483 OUTPUT:
484 RETVAL
485  
486 ##############################################################################
487 # Stamp XS bindings
488 ##############################################################################
489  
490 MODULE = PDF::Make PACKAGE = PDF::Make::Stamp
491 PROTOTYPES: ENABLE
492  
493 pdfmake_stamp_t *
494 text(class, format_sv, ...)
495 const char *class
496 SV *format_sv
497 PREINIT:
498 pdfmake_stamp_opts_t opts;
499 const char *format;
500 int i;
501 CODE:
502 PERL_UNUSED_VAR(class);
503 7 ▶ if (!SvOK(format_sv))
Branch: 1 branch
BranchTrueFalseTotal
if (!SvOK(format_sv)) 0 7 7
504 0 croak("Format string required");
505  
506 7 format = SvPV_nolen(format_sv);
507 7 pdfmake_stamp_opts_init(&opts);
508  
509 14 ▶ for (i = 2; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 2; i < items; i += 2) { 8 6 14
510 const char *key;
511 SV *val;
512 const char *pos;
513  
514 8 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 8 8
515 8 key = SvPV_nolen(ST(i));
516 8 val = ST(i + 1);
517  
518 8 ▶ if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "position")) { 3 5 8
519 3 ▶ if (!SvOK(val)) {
Branch: 1 branch
BranchTrueFalseTotal
if (!SvOK(val)) { 0 3 3
520 0 opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER;
521 3 ▶ } else if (SvIOK(val) || SvNOK(val)) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (SvIOK(val) || SvNOK(val)) { 2 1 3
} else if (SvIOK(val) || SvNOK(val)) { 0 2 2
522 1 opts.position = (pdfmake_stamp_position_t)SvIV(val);
523 } else {
524 2 pos = SvPV_nolen(val);
525 2 ▶ if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER; 0 2 2
526 2 ▶ else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL; 0 2 2
527 2 ▶ else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE; 0 2 2
528 2 ▶ else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM; 0 2 2
529 2 ▶ else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT; 0 2 2
530 2 ▶ else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER; 0 2 2
531 2 ▶ else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT; 0 2 2
532 2 ▶ else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT; 0 2 2
533 2 ▶ else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER; 0 2 2
534 2 ▶ else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT; 1 1 2
535 1 ▶ else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER; 0 1 1
536 1 ▶ else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER; 0 1 1
537 1 else croak("Unknown position: %s", pos);
538 }
539 }
540 5 ▶ else if (strEQ(key, "margin_x") || strEQ(key, "margin")) {
Branch: 2 branches
BranchTrueFalseTotal
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 4 1 5
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 4 4
541 1 opts.margin_x = SvNV(val);
542 }
543 4 ▶ else if (strEQ(key, "margin_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "margin_y")) { 1 3 4
544 1 opts.margin_y = SvNV(val);
545 }
546 3 ▶ else if (strEQ(key, "font")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "font")) { 1 2 3
547 1 opts.font_name = SvPV_nolen(val);
548 }
549 2 ▶ else if (strEQ(key, "size")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "size")) { 1 1 2
550 1 opts.font_size = SvNV(val);
551 }
552 1 ▶ else if (strEQ(key, "color")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "color")) { 1 0 1
553 1 ▶ if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 1 0 1
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 1 0 1
554 1 AV *av = (AV*)SvRV(val);
555 1 ▶ if (av_len(av) >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(av) >= 2) { 1 0 1
556 1 opts.color[0] = SvNV(*av_fetch(av, 0, 0));
557 1 opts.color[1] = SvNV(*av_fetch(av, 1, 0));
558 1 opts.color[2] = SvNV(*av_fetch(av, 2, 0));
559 }
560 }
561 }
562 }
563  
564 6 RETVAL = pdfmake_stamp_text(NULL, format, &opts);
565 6 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 6 6
566 0 croak("PDF::Make::Stamp: failed to create text stamp");
567 OUTPUT:
568 RETVAL
569  
570 pdfmake_stamp_t *
571 bates(class, ...)
572 const char *class
573 PREINIT:
574 pdfmake_stamp_opts_t opts;
575 3 const char *prefix = "";
576 3 const char *suffix = "";
577 3 int start = 1;
578 3 int digits = 6;
579 int i;
580 CODE:
581 PERL_UNUSED_VAR(class);
582 3 pdfmake_stamp_opts_init(&opts);
583  
584 15 ▶ for (i = 1; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 1; i < items; i += 2) { 12 3 15
585 const char *key;
586 SV *val;
587 const char *pos;
588  
589 12 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 12 12
590 12 key = SvPV_nolen(ST(i));
591 12 val = ST(i + 1);
592  
593 12 ▶ if (strEQ(key, "prefix")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "prefix")) { 3 9 12
594 3 prefix = SvPV_nolen(val);
595 }
596 9 ▶ else if (strEQ(key, "suffix")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "suffix")) { 2 7 9
597 2 suffix = SvPV_nolen(val);
598 }
599 7 ▶ else if (strEQ(key, "start")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "start")) { 3 4 7
600 3 start = SvIV(val);
601 }
602 4 ▶ else if (strEQ(key, "digits")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "digits")) { 3 1 4
603 3 digits = SvIV(val);
604 }
605 1 ▶ else if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "position")) { 1 0 1
606 1 ▶ if (!SvOK(val)) {
Branch: 1 branch
BranchTrueFalseTotal
if (!SvOK(val)) { 0 1 1
607 0 opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT;
608 1 ▶ } else if (SvIOK(val) || SvNOK(val)) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (SvIOK(val) || SvNOK(val)) { 1 0 1
} else if (SvIOK(val) || SvNOK(val)) { 0 1 1
609 0 opts.position = (pdfmake_stamp_position_t)SvIV(val);
610 } else {
611 1 pos = SvPV_nolen(val);
612 1 ▶ if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(pos, "center")) opts.position = PDFMAKE_WM_POS_CENTER; 0 1 1
613 1 ▶ else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "diagonal")) opts.position = PDFMAKE_WM_POS_DIAGONAL; 0 1 1
614 1 ▶ else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "tile")) opts.position = PDFMAKE_WM_POS_TILE; 0 1 1
615 1 ▶ else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "custom")) opts.position = PDFMAKE_WM_POS_CUSTOM; 0 1 1
616 1 ▶ else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_left")) opts.position = PDFMAKE_WM_POS_TOP_LEFT; 0 1 1
617 1 ▶ else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_center")) opts.position = PDFMAKE_WM_POS_TOP_CENTER; 0 1 1
618 1 ▶ else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "top_right")) opts.position = PDFMAKE_WM_POS_TOP_RIGHT; 0 1 1
619 1 ▶ else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_left")) opts.position = PDFMAKE_WM_POS_BOTTOM_LEFT; 0 1 1
620 1 ▶ else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_center")) opts.position = PDFMAKE_WM_POS_BOTTOM_CENTER; 0 1 1
621 1 ▶ else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "bottom_right")) opts.position = PDFMAKE_WM_POS_BOTTOM_RIGHT; 1 0 1
622 0 ▶ else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "left_center")) opts.position = PDFMAKE_WM_POS_LEFT_CENTER; 0 0 0
623 0 ▶ else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER;
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(pos, "right_center")) opts.position = PDFMAKE_WM_POS_RIGHT_CENTER; 0 0 0
624 0 else croak("Unknown position: %s", pos);
625 }
626 }
627 0 ▶ else if (strEQ(key, "margin_x") || strEQ(key, "margin")) {
Branch: 2 branches
BranchTrueFalseTotal
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 0 0
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 0 0
628 0 opts.margin_x = SvNV(val);
629 }
630 0 ▶ else if (strEQ(key, "margin_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "margin_y")) { 0 0 0
631 0 opts.margin_y = SvNV(val);
632 }
633 0 ▶ else if (strEQ(key, "font")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "font")) { 0 0 0
634 0 opts.font_name = SvPV_nolen(val);
635 }
636 0 ▶ else if (strEQ(key, "size")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "size")) { 0 0 0
637 0 opts.font_size = SvNV(val);
638 }
639 0 ▶ else if (strEQ(key, "color")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "color")) { 0 0 0
640 0 ▶ if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
641 0 AV *av = (AV*)SvRV(val);
642 0 ▶ if (av_len(av) >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(av) >= 2) { 0 0 0
643 0 opts.color[0] = SvNV(*av_fetch(av, 0, 0));
644 0 opts.color[1] = SvNV(*av_fetch(av, 1, 0));
645 0 opts.color[2] = SvNV(*av_fetch(av, 2, 0));
646 }
647 }
648 }
649 }
650  
651 3 RETVAL = pdfmake_stamp_bates(NULL, prefix, start, digits, suffix, &opts);
652 3 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 3 3
653 0 croak("PDF::Make::Stamp: failed to create Bates stamp");
654 OUTPUT:
655 RETVAL
656  
657 pdfmake_stamp_t *
658 _new_text(class, doc, format, ...)
659 const char *class
660 SV *doc
661 const char *format
662 PREINIT:
663 pdfmake_stamp_opts_t opts;
664 int i;
665 CODE:
666 PERL_UNUSED_VAR(doc);
667 PERL_UNUSED_VAR(class);
668 0 pdfmake_stamp_opts_init(&opts);
669
670 /* Parse optional hash arguments */
671 0 ▶ for (i = 3; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 3; i < items; i += 2) { 0 0 0
672 0 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 0 0
673 0 const char *key = SvPV_nolen(ST(i));
674 0 SV *val = ST(i + 1);
675
676 0 ▶ if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "position")) { 0 0 0
677 0 opts.position = (pdfmake_stamp_position_t)SvIV(val);
678 }
679 0 ▶ else if (strEQ(key, "margin_x") || strEQ(key, "margin")) {
Branch: 2 branches
BranchTrueFalseTotal
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 0 0
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 0 0
680 0 opts.margin_x = SvNV(val);
681 }
682 0 ▶ else if (strEQ(key, "margin_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "margin_y")) { 0 0 0
683 0 opts.margin_y = SvNV(val);
684 }
685 0 ▶ else if (strEQ(key, "font")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "font")) { 0 0 0
686 0 opts.font_name = SvPV_nolen(val);
687 }
688 0 ▶ else if (strEQ(key, "size")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "size")) { 0 0 0
689 0 opts.font_size = SvNV(val);
690 }
691 0 ▶ else if (strEQ(key, "color")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "color")) { 0 0 0
692 0 ▶ if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
693 0 AV *av = (AV*)SvRV(val);
694 0 ▶ if (av_len(av) >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(av) >= 2) { 0 0 0
695 0 opts.color[0] = SvNV(*av_fetch(av, 0, 0));
696 0 opts.color[1] = SvNV(*av_fetch(av, 1, 0));
697 0 opts.color[2] = SvNV(*av_fetch(av, 2, 0));
698 }
699 }
700 }
701 }
702
703 /* If margin was set but margin_y wasn't explicitly set, use same value */
704 /* This handles the common case of margin => 36 setting both */
705
706 0 RETVAL = pdfmake_stamp_text(NULL, format, &opts);
707 0 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 0 0
708 0 croak("PDF::Make::Stamp: failed to create text stamp");
709 OUTPUT:
710 RETVAL
711  
712 pdfmake_stamp_t *
713 _new_bates(class, doc, ...)
714 const char *class
715 SV *doc
716 PREINIT:
717 pdfmake_stamp_opts_t opts;
718 0 const char *prefix = "";
719 0 const char *suffix = "";
720 0 int start = 1;
721 0 int digits = 6;
722 int i;
723 CODE:
724 PERL_UNUSED_VAR(doc);
725 PERL_UNUSED_VAR(class);
726 0 pdfmake_stamp_opts_init(&opts);
727
728 /* Parse optional hash arguments */
729 0 ▶ for (i = 2; i < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 2; i < items; i += 2) { 0 0 0
730 0 ▶ if (i + 1 >= items) break;
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 >= items) break; 0 0 0
731 0 const char *key = SvPV_nolen(ST(i));
732 0 SV *val = ST(i + 1);
733
734 0 ▶ if (strEQ(key, "prefix")) {
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "prefix")) { 0 0 0
735 0 prefix = SvPV_nolen(val);
736 }
737 0 ▶ else if (strEQ(key, "suffix")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "suffix")) { 0 0 0
738 0 suffix = SvPV_nolen(val);
739 }
740 0 ▶ else if (strEQ(key, "start")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "start")) { 0 0 0
741 0 start = SvIV(val);
742 }
743 0 ▶ else if (strEQ(key, "digits")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "digits")) { 0 0 0
744 0 digits = SvIV(val);
745 }
746 0 ▶ else if (strEQ(key, "position")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "position")) { 0 0 0
747 0 opts.position = (pdfmake_stamp_position_t)SvIV(val);
748 }
749 0 ▶ else if (strEQ(key, "margin_x") || strEQ(key, "margin")) {
Branch: 2 branches
BranchTrueFalseTotal
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 0 0
else if (strEQ(key, "margin_x") || strEQ(key, "margin")) { 0 0 0
750 0 opts.margin_x = SvNV(val);
751 }
752 0 ▶ else if (strEQ(key, "margin_y")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "margin_y")) { 0 0 0
753 0 opts.margin_y = SvNV(val);
754 }
755 0 ▶ else if (strEQ(key, "font")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "font")) { 0 0 0
756 0 opts.font_name = SvPV_nolen(val);
757 }
758 0 ▶ else if (strEQ(key, "size")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "size")) { 0 0 0
759 0 opts.font_size = SvNV(val);
760 }
761 0 ▶ else if (strEQ(key, "color")) {
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "color")) { 0 0 0
762 0 ▶ if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
if (SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVAV) { 0 0 0
763 0 AV *av = (AV*)SvRV(val);
764 0 ▶ if (av_len(av) >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(av) >= 2) { 0 0 0
765 0 opts.color[0] = SvNV(*av_fetch(av, 0, 0));
766 0 opts.color[1] = SvNV(*av_fetch(av, 1, 0));
767 0 opts.color[2] = SvNV(*av_fetch(av, 2, 0));
768 }
769 }
770 }
771 }
772
773 0 RETVAL = pdfmake_stamp_bates(NULL, prefix, start, digits, suffix, &opts);
774 0 ▶ if (!RETVAL)
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) 0 0 0
775 0 croak("PDF::Make::Stamp: failed to create Bates stamp");
776 OUTPUT:
777 RETVAL
778  
779 void
780 DESTROY(self)
781 pdfmake_stamp_t *self
782 CODE:
783 9 pdfmake_stamp_free(self);
784  
785 const char *
786 type(self)
787 pdfmake_stamp_t *self
788 CODE:
789 2 ▶ RETVAL = (self->type == PDFMAKE_WM_STAMP_TEXT) ? "text" : "bates";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (self->type == PDFMAKE_WM_STAMP_TEXT) ? "text" : "bates"; 1 1 2
790 OUTPUT:
791 RETVAL
792  
793 const char *
794 type_name(self)
795 pdfmake_stamp_t *self
796 CODE:
797 0 ▶ RETVAL = (self->type == PDFMAKE_WM_STAMP_TEXT) ? "text" : "bates";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (self->type == PDFMAKE_WM_STAMP_TEXT) ? "text" : "bates"; 0 0 0
798 OUTPUT:
799 RETVAL
800  
801 const char *
802 format(self)
803 pdfmake_stamp_t *self
804 CODE:
805 1 ▶ if (self->type == PDFMAKE_WM_STAMP_TEXT)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_TEXT) 1 0 1
806 1 ▶ RETVAL = self->data.text.format ? self->data.text.format : "";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->data.text.format ? self->data.text.format : ""; 1 0 1
807 else
808 0 RETVAL = "";
809 OUTPUT:
810 RETVAL
811  
812 const char *
813 prefix(self)
814 pdfmake_stamp_t *self
815 CODE:
816 1 ▶ if (self->type == PDFMAKE_WM_STAMP_BATES)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_BATES) 1 0 1
817 1 ▶ RETVAL = self->data.bates.prefix ? self->data.bates.prefix : "";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->data.bates.prefix ? self->data.bates.prefix : ""; 1 0 1
818 else
819 0 RETVAL = "";
820 OUTPUT:
821 RETVAL
822  
823 const char *
824 suffix(self)
825 pdfmake_stamp_t *self
826 CODE:
827 1 ▶ if (self->type == PDFMAKE_WM_STAMP_BATES)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_BATES) 1 0 1
828 1 ▶ RETVAL = self->data.bates.suffix ? self->data.bates.suffix : "";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->data.bates.suffix ? self->data.bates.suffix : ""; 1 0 1
829 else
830 0 RETVAL = "";
831 OUTPUT:
832 RETVAL
833  
834 int
835 start(self)
836 pdfmake_stamp_t *self
837 CODE:
838 1 ▶ if (self->type == PDFMAKE_WM_STAMP_BATES)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_BATES) 1 0 1
839 1 RETVAL = self->data.bates.start_number;
840 else
841 0 RETVAL = 0;
842 OUTPUT:
843 RETVAL
844  
845 int
846 digits(self)
847 pdfmake_stamp_t *self
848 CODE:
849 1 ▶ if (self->type == PDFMAKE_WM_STAMP_BATES)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_BATES) 1 0 1
850 1 RETVAL = self->data.bates.digits;
851 else
852 0 RETVAL = 0;
853 OUTPUT:
854 RETVAL
855  
856 int
857 position(self)
858 pdfmake_stamp_t *self
859 CODE:
860 3 ▶ RETVAL = self->opts.position;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.position; 0 3 3
861 OUTPUT:
862 RETVAL
863  
864 double
865 margin_x(self)
866 pdfmake_stamp_t *self
867 CODE:
868 2 ▶ RETVAL = self->opts.margin_x;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.margin_x; 0 2 2
869 OUTPUT:
870 RETVAL
871  
872 double
873 margin_y(self)
874 pdfmake_stamp_t *self
875 CODE:
876 1 ▶ RETVAL = self->opts.margin_y;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.margin_y; 0 1 1
877 OUTPUT:
878 RETVAL
879  
880 const char *
881 font(self)
882 pdfmake_stamp_t *self
883 CODE:
884 2 ▶ RETVAL = self->opts.font_name ? self->opts.font_name : "Helvetica";
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.font_name ? self->opts.font_name : "Helvetica"; 2 0 2
885 OUTPUT:
886 RETVAL
887  
888 double
889 size(self)
890 pdfmake_stamp_t *self
891 CODE:
892 2 ▶ RETVAL = self->opts.font_size;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->opts.font_size; 0 2 2
893 OUTPUT:
894 RETVAL
895  
896 SV *
897 color(self)
898 pdfmake_stamp_t *self
899 PREINIT:
900 AV *av;
901 CODE:
902 1 av = newAV();
903 1 av_push(av, newSVnv(self->opts.color[0]));
904 1 av_push(av, newSVnv(self->opts.color[1]));
905 1 av_push(av, newSVnv(self->opts.color[2]));
906 1 RETVAL = newRV_noinc((SV*)av);
907 OUTPUT:
908 RETVAL
909  
910 void
911 reset(self)
912 pdfmake_stamp_t *self
913 CODE:
914 1 ▶ if (self->type == PDFMAKE_WM_STAMP_BATES)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_BATES) 1 0 1
915 1 self->data.bates.current_number = self->data.bates.start_number;
916  
917 SV *
918 next_bates(self)
919 pdfmake_stamp_t *self
920 PREINIT:
921 char *text;
922 CODE:
923 4 ▶ if (self->type != PDFMAKE_WM_STAMP_BATES)
Branch: 1 branch
BranchTrueFalseTotal
if (self->type != PDFMAKE_WM_STAMP_BATES) 0 4 4
924 0 XSRETURN_UNDEF;
925
926 4 text = pdfmake_stamp_expand_bates(
927 4 self->data.bates.prefix,
928 self->data.bates.current_number,
929 self->data.bates.digits,
930 4 self->data.bates.suffix
931 );
932 4 self->data.bates.current_number++;
933
934 4 ▶ if (text) {
Branch: 1 branch
BranchTrueFalseTotal
if (text) { 4 0 4
935 4 RETVAL = newSVpv(text, 0);
936 4 pdfmake_cfree(text);
937 } else {
938 0 XSRETURN_UNDEF;
939 }
940 OUTPUT:
941 RETVAL
942  
943 SV *
944 expand(self, page_num, total_pages, ...)
945 pdfmake_stamp_t *self
946 int page_num
947 int total_pages
948 PREINIT:
949 char *text;
950 2 const char *filename = NULL;
951 CODE:
952 2 ▶ if (items > 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items > 3) 0 2 2
953 0 filename = SvPV_nolen(ST(3));
954
955 2 ▶ if (self->type == PDFMAKE_WM_STAMP_BATES) {
Branch: 1 branch
BranchTrueFalseTotal
if (self->type == PDFMAKE_WM_STAMP_BATES) { 0 2 2
956 0 text = pdfmake_stamp_expand_bates(
957 0 self->data.bates.prefix,
958 self->data.bates.current_number,
959 self->data.bates.digits,
960 0 self->data.bates.suffix
961 );
962 0 self->data.bates.current_number++;
963 } else {
964 2 text = pdfmake_stamp_expand_format(
965 2 self->data.text.format,
966 page_num,
967 total_pages,
968 filename
969 );
970 }
971
972 2 ▶ if (text) {
Branch: 1 branch
BranchTrueFalseTotal
if (text) { 2 0 2
973 2 RETVAL = newSVpv(text, 0);
974 2 pdfmake_cfree(text);
975 } else {
976 0 XSRETURN_UNDEF;
977 }
978 OUTPUT:
979 RETVAL
980  
981 ##############################################################################
982 # Document watermark/stamp methods
983 ##############################################################################
984  
985 MODULE = PDF::Make PACKAGE = PDF::Make::Document
986  
987 void
988 add_watermark(self, wm)
989 pdfmake_doc_t *self
990 pdfmake_watermark_t *wm
991 CODE:
992 2 ▶ if (pdfmake_doc_add_watermark(self, wm) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_doc_add_watermark(self, wm) != PDFMAKE_OK) 0 2 2
993 0 croak("PDF::Make::Document::add_watermark: failed");
994  
995 void
996 apply_stamp(self, stamp)
997 pdfmake_doc_t *self
998 pdfmake_stamp_t *stamp
999 CODE:
1000 2 ▶ if (pdfmake_doc_add_stamp(self, stamp) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_doc_add_stamp(self, stamp) != PDFMAKE_OK) 0 2 2
1001 0 croak("PDF::Make::Document::apply_stamp: failed");
1002  
1003  
1004 BOOT:
1005 {
1006 104 HV *stash = gv_stashpv("PDF::Make::Watermark", GV_ADD);
1007 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "position", pdfmake_watermark_t, opts.position, PDFMAKE_FIELD_INT);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "position", pdfmake_watermark_t, opts.position, PDFMAKE_FIELD_INT); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "position", pdfmake_watermark_t, opts.position, PDFMAKE_FIELD_INT); 104 0 104
1008 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "opacity", pdfmake_watermark_t, opts.opacity, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "opacity", pdfmake_watermark_t, opts.opacity, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "opacity", pdfmake_watermark_t, opts.opacity, PDFMAKE_FIELD_DOUBLE); 104 0 104
1009 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "rotation", pdfmake_watermark_t, opts.rotation, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "rotation", pdfmake_watermark_t, opts.rotation, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "rotation", pdfmake_watermark_t, opts.rotation, PDFMAKE_FIELD_DOUBLE); 104 0 104
1010 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "scale", pdfmake_watermark_t, opts.scale, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "scale", pdfmake_watermark_t, opts.scale, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "scale", pdfmake_watermark_t, opts.scale, PDFMAKE_FIELD_DOUBLE); 104 0 104
1011 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "x_offset", pdfmake_watermark_t, opts.x_offset, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "x_offset", pdfmake_watermark_t, opts.x_offset, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "x_offset", pdfmake_watermark_t, opts.x_offset, PDFMAKE_FIELD_DOUBLE); 104 0 104
1012 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "y_offset", pdfmake_watermark_t, opts.y_offset, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "y_offset", pdfmake_watermark_t, opts.y_offset, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "y_offset", pdfmake_watermark_t, opts.y_offset, PDFMAKE_FIELD_DOUBLE); 104 0 104
1013 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "overlay", pdfmake_watermark_t, opts.as_overlay, PDFMAKE_FIELD_INT);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "overlay", pdfmake_watermark_t, opts.as_overlay, PDFMAKE_FIELD_INT); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "overlay", pdfmake_watermark_t, opts.as_overlay, PDFMAKE_FIELD_INT); 104 0 104
1014 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "font_size", pdfmake_watermark_t, opts.font_size, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "font_size", pdfmake_watermark_t, opts.font_size, PDFMAKE_FIELD_DOUBLE); 0 104 104
PDFMAKE_REGISTER_GETTER(stash, "font_size", pdfmake_watermark_t, opts.font_size, PDFMAKE_FIELD_DOUBLE); 0 0 0
1015 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "tile_spacing_x", pdfmake_watermark_t, opts.tile_spacing_x, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "tile_spacing_x", pdfmake_watermark_t, opts.tile_spacing_x, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "tile_spacing_x", pdfmake_watermark_t, opts.tile_spacing_x, PDFMAKE_FIELD_DOUBLE); 104 0 104
1016 104 ▶ PDFMAKE_REGISTER_GETTER(stash, "tile_spacing_y", pdfmake_watermark_t, opts.tile_spacing_y, PDFMAKE_FIELD_DOUBLE);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_GETTER(stash, "tile_spacing_y", pdfmake_watermark_t, opts.tile_spacing_y, PDFMAKE_FIELD_DOUBLE); 104 0 104
PDFMAKE_REGISTER_GETTER(stash, "tile_spacing_y", pdfmake_watermark_t, opts.tile_spacing_y, PDFMAKE_FIELD_DOUBLE); 104 0 104
1017 }
« src/pdfmake_meta.c ↑ Summary src/pdfmake_pkcs12.c »