@lpdfio/lpdf 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/L.d.ts +7 -2
- package/dist/L.js +6 -0
- package/dist/_shared.d.ts +42 -3
- package/dist/_shared.js +52 -3
- package/dist/attrs.d.ts +733 -65
- package/dist/browser.js +126 -47
- package/dist/canvas.d.ts +13 -12
- package/dist/constants.d.ts +27 -0
- package/dist/constants.js +25 -1
- package/dist/engine.d.ts +19 -28
- package/dist/engine.js +129 -27
- package/dist/index.d.ts +6 -5
- package/dist/index.js +7 -1
- package/dist/kit.d.ts +49 -33
- package/dist/kit.js +7 -1
- package/dist/layout.d.ts +62 -19
- package/dist/layout.js +26 -0
- package/dist/markdown.d.ts +76 -0
- package/dist/markdown.js +63 -0
- package/dist/wasm/lpdf-web.js +191 -36
- package/dist/wasm/lpdf.js +197 -36
- package/dist/wasm/lpdf_bg.wasm +0 -0
- package/package.json +4 -1
package/dist/attrs.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ export interface ColumnAttr {
|
|
|
15
15
|
/**
|
|
16
16
|
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
17
17
|
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
18
|
-
* bottom and left.
|
|
18
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
19
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
19
20
|
*/
|
|
20
21
|
padding?: string;
|
|
21
22
|
/**
|
|
@@ -33,7 +34,7 @@ export interface ColumnAttr {
|
|
|
33
34
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
34
35
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
35
36
|
*/
|
|
36
|
-
opacity?:
|
|
37
|
+
opacity?: number;
|
|
37
38
|
/**
|
|
38
39
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
39
40
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -47,12 +48,13 @@ export interface ColumnAttr {
|
|
|
47
48
|
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
48
49
|
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
49
50
|
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
50
|
-
* both to the next page if that sibling would not fit
|
|
51
|
-
*
|
|
52
|
-
*
|
|
51
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
52
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
53
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
54
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
53
55
|
*/
|
|
54
56
|
paginate?: string;
|
|
55
|
-
debug?:
|
|
57
|
+
debug?: boolean;
|
|
56
58
|
align?: string;
|
|
57
59
|
justify?: string;
|
|
58
60
|
/**
|
|
@@ -81,7 +83,8 @@ export interface RowAttr {
|
|
|
81
83
|
/**
|
|
82
84
|
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
83
85
|
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
84
|
-
* bottom and left.
|
|
86
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
87
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
85
88
|
*/
|
|
86
89
|
padding?: string;
|
|
87
90
|
/**
|
|
@@ -99,7 +102,7 @@ export interface RowAttr {
|
|
|
99
102
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
100
103
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
101
104
|
*/
|
|
102
|
-
opacity?:
|
|
105
|
+
opacity?: number;
|
|
103
106
|
/**
|
|
104
107
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
105
108
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -113,12 +116,13 @@ export interface RowAttr {
|
|
|
113
116
|
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
114
117
|
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
115
118
|
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
116
|
-
* both to the next page if that sibling would not fit
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
120
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
121
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
122
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
119
123
|
*/
|
|
120
124
|
paginate?: string;
|
|
121
|
-
debug?:
|
|
125
|
+
debug?: boolean;
|
|
122
126
|
align?: string;
|
|
123
127
|
justify?: string;
|
|
124
128
|
/**
|
|
@@ -145,7 +149,8 @@ export interface GridAttr {
|
|
|
145
149
|
/**
|
|
146
150
|
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
147
151
|
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
148
|
-
* bottom and left.
|
|
152
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
153
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
149
154
|
*/
|
|
150
155
|
padding?: string;
|
|
151
156
|
/**
|
|
@@ -163,7 +168,7 @@ export interface GridAttr {
|
|
|
163
168
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
164
169
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
165
170
|
*/
|
|
166
|
-
opacity?:
|
|
171
|
+
opacity?: number;
|
|
167
172
|
/**
|
|
168
173
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
169
174
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -177,12 +182,13 @@ export interface GridAttr {
|
|
|
177
182
|
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
178
183
|
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
179
184
|
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
180
|
-
* both to the next page if that sibling would not fit
|
|
181
|
-
*
|
|
182
|
-
*
|
|
185
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
186
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
187
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
188
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
183
189
|
*/
|
|
184
190
|
paginate?: string;
|
|
185
|
-
debug?:
|
|
191
|
+
debug?: boolean;
|
|
186
192
|
/**
|
|
187
193
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
188
194
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -190,7 +196,177 @@ export interface GridAttr {
|
|
|
190
196
|
*/
|
|
191
197
|
width?: string;
|
|
192
198
|
colWidth?: string;
|
|
193
|
-
cols?:
|
|
199
|
+
cols?: number;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A list of items, each with a marker: a bullet drawn as a shape, or a number the engine gives. The
|
|
203
|
+
* items go top to bottom with gap between them, each one a li, and a list nests inside an item. The
|
|
204
|
+
* words of an item start indent from the list's left edge, at every level. A long item splits
|
|
205
|
+
* across pages through the line the page ends in, and its marker stays with the first part.
|
|
206
|
+
*/
|
|
207
|
+
export interface ListAttr {
|
|
208
|
+
font?: string;
|
|
209
|
+
fontSize?: string;
|
|
210
|
+
/**
|
|
211
|
+
* The color of the text inside the box. A text that sets no color of its own takes the nearest
|
|
212
|
+
* box's, and the text token when no box sets one. A divider or a barcode in the box keeps its own
|
|
213
|
+
* color.
|
|
214
|
+
*/
|
|
215
|
+
color?: string;
|
|
216
|
+
gap?: string;
|
|
217
|
+
/**
|
|
218
|
+
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
219
|
+
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
220
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
221
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
222
|
+
*/
|
|
223
|
+
padding?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Height of the box. Leave it out to size to the content. A length, or a name from the height row
|
|
226
|
+
* of the tokens, fixes it; fill takes what is left after its siblings (shared equally if several
|
|
227
|
+
* use fill); full takes all the height available. Any of these stops the box splitting across
|
|
228
|
+
* pages.
|
|
229
|
+
*/
|
|
230
|
+
height?: string;
|
|
231
|
+
background?: string;
|
|
232
|
+
border?: string;
|
|
233
|
+
radius?: string;
|
|
234
|
+
/**
|
|
235
|
+
* How opaque the box and everything in it is, from 0 to 1. The box is faded as one, so children
|
|
236
|
+
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
237
|
+
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
238
|
+
*/
|
|
239
|
+
opacity?: number;
|
|
240
|
+
/**
|
|
241
|
+
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
242
|
+
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
243
|
+
* from 0 to 1 after the color fades the shadow alone: "2pt 3pt #000000 0.2". There is no blur.
|
|
244
|
+
* The shadow takes no room in the layout, so it can run into the margin or a neighbor, and the
|
|
245
|
+
* siblings after the box are drawn over it. A box with no background shows the shadow only
|
|
246
|
+
* outside it. The box's own opacity fades the box and its shadow together.
|
|
247
|
+
*/
|
|
248
|
+
shadow?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
251
|
+
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
252
|
+
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
253
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
254
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
255
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
256
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
257
|
+
*/
|
|
258
|
+
paginate?: string;
|
|
259
|
+
debug?: boolean;
|
|
260
|
+
/** bullet marks each item with a shape, number with a number. Default bullet. */
|
|
261
|
+
type?: string;
|
|
262
|
+
/**
|
|
263
|
+
* How a number list writes its numbers: decimal (1, 2, 3), lower-alpha (a, b, c, then aa, ab),
|
|
264
|
+
* upper-alpha (A, B, C), lower-roman (i, ii, iii) or upper-roman (I, II, III). A number that a
|
|
265
|
+
* letter or a numeral can't write, below 1 or past 3999 for a numeral, is written in decimal.
|
|
266
|
+
* Default decimal.
|
|
267
|
+
*/
|
|
268
|
+
format?: string;
|
|
269
|
+
/**
|
|
270
|
+
* The number of a number list's first item, to continue a list that something cut in two. Default
|
|
271
|
+
* 1.
|
|
272
|
+
*/
|
|
273
|
+
start?: number;
|
|
274
|
+
/**
|
|
275
|
+
* Text before each number of a number list: prefix="(" and suffix=")" write (a). Default none.
|
|
276
|
+
*/
|
|
277
|
+
prefix?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Text after each number of a number list: suffix=")" writes a). Default a full stop, so a number
|
|
280
|
+
* is written 1.
|
|
281
|
+
*/
|
|
282
|
+
suffix?: string;
|
|
283
|
+
/**
|
|
284
|
+
* The shape that marks the items of a bullet list. Without it a list uses a disc, a list inside a
|
|
285
|
+
* bullet list a circle, and one inside that a square, then the three again.
|
|
286
|
+
*/
|
|
287
|
+
bullet?: string;
|
|
288
|
+
/**
|
|
289
|
+
* The width of the marker's column: the words of an item start this far from the list's left
|
|
290
|
+
* edge, and a list inside an item starts there too. The marker is set at the right of its column,
|
|
291
|
+
* so 9. and 10. end together, and a marker wider than the column is not made to fit. The same
|
|
292
|
+
* length at every level. Default 24pt.
|
|
293
|
+
*/
|
|
294
|
+
indent?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
297
|
+
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
298
|
+
* line; in a column it takes the full width.
|
|
299
|
+
*/
|
|
300
|
+
width?: string;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* One item of a list: a box that holds what a layout holds, such as a text, an image, a table or
|
|
304
|
+
* another list, and sits beside the item's marker. The words go in a text. data-source repeats the
|
|
305
|
+
* item once for each entry of the data, and the numbers of a number list follow what is made. The
|
|
306
|
+
* item's own box (padding, background, border) surrounds the marker and the content, and its gap
|
|
307
|
+
* goes between its children: the gap of the list, unless the item sets one.
|
|
308
|
+
*/
|
|
309
|
+
export interface LiAttr {
|
|
310
|
+
font?: string;
|
|
311
|
+
fontSize?: string;
|
|
312
|
+
/**
|
|
313
|
+
* The color of the text inside the box. A text that sets no color of its own takes the nearest
|
|
314
|
+
* box's, and the text token when no box sets one. A divider or a barcode in the box keeps its own
|
|
315
|
+
* color.
|
|
316
|
+
*/
|
|
317
|
+
color?: string;
|
|
318
|
+
gap?: string;
|
|
319
|
+
/**
|
|
320
|
+
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
321
|
+
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
322
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
323
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
324
|
+
*/
|
|
325
|
+
padding?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Height of the box. Leave it out to size to the content. A length, or a name from the height row
|
|
328
|
+
* of the tokens, fixes it; fill takes what is left after its siblings (shared equally if several
|
|
329
|
+
* use fill); full takes all the height available. Any of these stops the box splitting across
|
|
330
|
+
* pages.
|
|
331
|
+
*/
|
|
332
|
+
height?: string;
|
|
333
|
+
background?: string;
|
|
334
|
+
border?: string;
|
|
335
|
+
radius?: string;
|
|
336
|
+
/**
|
|
337
|
+
* How opaque the box and everything in it is, from 0 to 1. The box is faded as one, so children
|
|
338
|
+
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
339
|
+
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
340
|
+
*/
|
|
341
|
+
opacity?: number;
|
|
342
|
+
/**
|
|
343
|
+
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
344
|
+
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
345
|
+
* from 0 to 1 after the color fades the shadow alone: "2pt 3pt #000000 0.2". There is no blur.
|
|
346
|
+
* The shadow takes no room in the layout, so it can run into the margin or a neighbor, and the
|
|
347
|
+
* siblings after the box are drawn over it. A box with no background shows the shadow only
|
|
348
|
+
* outside it. The box's own opacity fades the box and its shadow together.
|
|
349
|
+
*/
|
|
350
|
+
shadow?: string;
|
|
351
|
+
/**
|
|
352
|
+
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
353
|
+
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
354
|
+
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
355
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
356
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
357
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
358
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
359
|
+
*/
|
|
360
|
+
paginate?: string;
|
|
361
|
+
debug?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Makes the item's marker a checkbox in place of the bullet or the number: an outline in the line
|
|
364
|
+
* color, with a tick in the color of the item's words when this is true, and empty when it is
|
|
365
|
+
* false. The words start where those of a bullet do, and an item of a number list still takes its
|
|
366
|
+
* number. An item without it keeps its bullet or number. A task item of a Markdown, - [ ] or -
|
|
367
|
+
* [x], is one.
|
|
368
|
+
*/
|
|
369
|
+
checked?: boolean;
|
|
194
370
|
}
|
|
195
371
|
/**
|
|
196
372
|
* A box around a single child, which it centres. Never splits across pages: if it does not fit, the
|
|
@@ -208,7 +384,8 @@ export interface FrameAttr {
|
|
|
208
384
|
/**
|
|
209
385
|
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
210
386
|
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
211
|
-
* bottom and left.
|
|
387
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
388
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
212
389
|
*/
|
|
213
390
|
padding?: string;
|
|
214
391
|
/**
|
|
@@ -226,7 +403,7 @@ export interface FrameAttr {
|
|
|
226
403
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
227
404
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
228
405
|
*/
|
|
229
|
-
opacity?:
|
|
406
|
+
opacity?: number;
|
|
230
407
|
/**
|
|
231
408
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
232
409
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -240,12 +417,13 @@ export interface FrameAttr {
|
|
|
240
417
|
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
241
418
|
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
242
419
|
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
243
|
-
* both to the next page if that sibling would not fit
|
|
244
|
-
*
|
|
245
|
-
*
|
|
420
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
421
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
422
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
423
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
246
424
|
*/
|
|
247
425
|
paginate?: string;
|
|
248
|
-
debug?:
|
|
426
|
+
debug?: boolean;
|
|
249
427
|
/**
|
|
250
428
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
251
429
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -270,7 +448,7 @@ export interface LinkAttr {
|
|
|
270
448
|
*/
|
|
271
449
|
width?: string;
|
|
272
450
|
height?: string;
|
|
273
|
-
debug?:
|
|
451
|
+
debug?: boolean;
|
|
274
452
|
}
|
|
275
453
|
/**
|
|
276
454
|
* Attributes of the `divider` element.
|
|
@@ -285,22 +463,34 @@ export interface DividerAttr {
|
|
|
285
463
|
* line; in a column it takes the full width.
|
|
286
464
|
*/
|
|
287
465
|
width?: string;
|
|
288
|
-
debug?:
|
|
466
|
+
debug?: boolean;
|
|
289
467
|
}
|
|
290
468
|
/**
|
|
291
469
|
* Attributes of the `span` element.
|
|
292
470
|
*/
|
|
293
471
|
export interface SpanAttr {
|
|
294
472
|
font?: string;
|
|
295
|
-
bold?:
|
|
473
|
+
bold?: boolean;
|
|
296
474
|
color?: string;
|
|
297
475
|
/**
|
|
298
476
|
* Makes the span a link: a URL, or #id to jump to the bookmark with that id. In an entry of a
|
|
299
477
|
* table of contents, # alone jumps to that entry's bookmark.
|
|
300
478
|
*/
|
|
301
479
|
href?: string;
|
|
302
|
-
underline?:
|
|
303
|
-
strike?:
|
|
480
|
+
underline?: boolean;
|
|
481
|
+
strike?: boolean;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* A run of code inside a text: its words in Courier on a light tint, the tint drawn behind them. It
|
|
485
|
+
* is the inline twin of code, and like a span it is not broken inside, so it goes to the next line
|
|
486
|
+
* whole, and a run longer than a whole line breaks at the last character that fits, so nothing runs
|
|
487
|
+
* past the box. White space in it collapses as in the text around it.
|
|
488
|
+
*/
|
|
489
|
+
export interface CodeSpanAttr {
|
|
490
|
+
font?: string;
|
|
491
|
+
color?: string;
|
|
492
|
+
/** The tint drawn behind the run. Default #f3f4f6. */
|
|
493
|
+
background?: string;
|
|
304
494
|
}
|
|
305
495
|
/**
|
|
306
496
|
* An image. It is never stretched. With only a width or a height, the other follows the image's
|
|
@@ -326,7 +516,7 @@ export interface ImgAttr {
|
|
|
326
516
|
border?: string;
|
|
327
517
|
radius?: string;
|
|
328
518
|
paginate?: string;
|
|
329
|
-
debug?:
|
|
519
|
+
debug?: boolean;
|
|
330
520
|
}
|
|
331
521
|
/**
|
|
332
522
|
* A rectangle, a circle or an ellipse in the layout, for a status dot, a color swatch or a progress
|
|
@@ -357,8 +547,8 @@ export interface ShapeAttr {
|
|
|
357
547
|
strokeWidth?: string;
|
|
358
548
|
strokeDash?: string;
|
|
359
549
|
/** How opaque the shape is, from 0 to 1. Default 1. */
|
|
360
|
-
opacity?:
|
|
361
|
-
debug?:
|
|
550
|
+
opacity?: number;
|
|
551
|
+
debug?: boolean;
|
|
362
552
|
}
|
|
363
553
|
/**
|
|
364
554
|
* A QR code, a Code 128 or an EAN-13. It is never stretched. With only a width or a height, the
|
|
@@ -381,7 +571,7 @@ export interface BarcodeAttr {
|
|
|
381
571
|
*/
|
|
382
572
|
height?: string;
|
|
383
573
|
ec?: string;
|
|
384
|
-
hrt?:
|
|
574
|
+
hrt?: boolean;
|
|
385
575
|
color?: string;
|
|
386
576
|
background?: string;
|
|
387
577
|
/**
|
|
@@ -391,7 +581,7 @@ export interface BarcodeAttr {
|
|
|
391
581
|
*/
|
|
392
582
|
width?: string;
|
|
393
583
|
paginate?: string;
|
|
394
|
-
debug?:
|
|
584
|
+
debug?: boolean;
|
|
395
585
|
}
|
|
396
586
|
/**
|
|
397
587
|
* A block of wrapping text. Use span children to style parts of it, and fn children for footnotes.
|
|
@@ -405,28 +595,28 @@ export interface TextAttr {
|
|
|
405
595
|
* Helvetica-Bold, Times-Roman becomes Times-Bold, Courier becomes Courier-Bold, and the oblique
|
|
406
596
|
* and italic faces their bold forms. A custom font has no bold face to pick, so name one in font.
|
|
407
597
|
*/
|
|
408
|
-
bold?:
|
|
598
|
+
bold?: boolean;
|
|
409
599
|
color?: string;
|
|
410
600
|
align?: string;
|
|
411
601
|
/**
|
|
412
602
|
* The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
|
|
413
603
|
* name from the line-height row of the tokens. Default 1.2, which is the token m.
|
|
414
604
|
*/
|
|
415
|
-
lineHeight?: string;
|
|
605
|
+
lineHeight?: string | number;
|
|
416
606
|
/**
|
|
417
607
|
* The most lines drawn. Only whole lines are drawn, and the rest of the text is dropped. A text
|
|
418
608
|
* in the layout has no cap by default and wraps at the width it has; the lines it drops take no
|
|
419
609
|
* room, and a text that splits across pages keeps the cap across them. A text-at is one line by
|
|
420
610
|
* default, and above 1 needs a width to wrap within.
|
|
421
611
|
*/
|
|
422
|
-
maxLines?:
|
|
612
|
+
maxLines?: number;
|
|
423
613
|
/**
|
|
424
614
|
* End the last line drawn in an ellipsis when max-lines drops text, shortened to fit the width.
|
|
425
615
|
* Off by default: the text stops at the end of a line. A text-at also ends a line in one when it
|
|
426
616
|
* is cut off at its width. A text in the layout without max-lines is never cut, so there it has
|
|
427
617
|
* no effect.
|
|
428
618
|
*/
|
|
429
|
-
ellipsis?:
|
|
619
|
+
ellipsis?: boolean;
|
|
430
620
|
/**
|
|
431
621
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
432
622
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -438,14 +628,14 @@ export interface TextAttr {
|
|
|
438
628
|
* Default 2. If fewer would be left, lines move from the first page to the next; 1 turns the
|
|
439
629
|
* protection off.
|
|
440
630
|
*/
|
|
441
|
-
widows?:
|
|
631
|
+
widows?: number;
|
|
442
632
|
/**
|
|
443
633
|
* The fewest lines of the text that may stand alone at the bottom of a page when it splits.
|
|
444
634
|
* Default 2. If fewer would fit, the whole text moves to the next page; 1 turns the protection
|
|
445
635
|
* off. When no split can keep both widows and orphans, even on an empty page, the text splits
|
|
446
636
|
* where the lines fit.
|
|
447
637
|
*/
|
|
448
|
-
orphans?:
|
|
638
|
+
orphans?: number;
|
|
449
639
|
/**
|
|
450
640
|
* Records the words of this text under a name as the pages are filled, so a text with capture-ref
|
|
451
641
|
* in a header or a footer can show them. Put it on a heading in the flow. The page that holds the
|
|
@@ -472,7 +662,99 @@ export interface TextAttr {
|
|
|
472
662
|
*/
|
|
473
663
|
captureFallback?: string;
|
|
474
664
|
paginate?: string;
|
|
475
|
-
debug?:
|
|
665
|
+
debug?: boolean;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Code, or any text whose spaces and lines matter, in a box. The text is kept as it is written:
|
|
669
|
+
* every space, and a new line wherever one is written, except the line break after the start tag
|
|
670
|
+
* and the indent of the line the end tag stands on. A line longer than the box wraps at a space,
|
|
671
|
+
* and a word with none breaks at the last character that fits, so nothing is cut off. A tab fills
|
|
672
|
+
* to the next multiple of tab-size columns. The box fills the width and grows with its lines, in
|
|
673
|
+
* Courier on a light tint with padding m unless font, background and padding say otherwise. It
|
|
674
|
+
* holds text and span children, which color or style parts of it. It splits across pages between
|
|
675
|
+
* lines, and each part is drawn in its own box. A code element is a column around one text, so the
|
|
676
|
+
* text takes its font, size and color from font, font-size and color.
|
|
677
|
+
*/
|
|
678
|
+
export interface CodeAttr {
|
|
679
|
+
font?: string;
|
|
680
|
+
fontSize?: string;
|
|
681
|
+
/**
|
|
682
|
+
* The color of the text inside the box. A text that sets no color of its own takes the nearest
|
|
683
|
+
* box's, and the text token when no box sets one. A divider or a barcode in the box keeps its own
|
|
684
|
+
* color.
|
|
685
|
+
*/
|
|
686
|
+
color?: string;
|
|
687
|
+
/**
|
|
688
|
+
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
689
|
+
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
690
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
691
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
692
|
+
*/
|
|
693
|
+
padding?: string;
|
|
694
|
+
/**
|
|
695
|
+
* Height of the box. Leave it out to size to the content. A length, or a name from the height row
|
|
696
|
+
* of the tokens, fixes it; fill takes what is left after its siblings (shared equally if several
|
|
697
|
+
* use fill); full takes all the height available. Any of these stops the box splitting across
|
|
698
|
+
* pages.
|
|
699
|
+
*/
|
|
700
|
+
height?: string;
|
|
701
|
+
background?: string;
|
|
702
|
+
border?: string;
|
|
703
|
+
radius?: string;
|
|
704
|
+
/**
|
|
705
|
+
* How opaque the box and everything in it is, from 0 to 1. The box is faded as one, so children
|
|
706
|
+
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
707
|
+
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
708
|
+
*/
|
|
709
|
+
opacity?: number;
|
|
710
|
+
/**
|
|
711
|
+
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
712
|
+
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
713
|
+
* from 0 to 1 after the color fades the shadow alone: "2pt 3pt #000000 0.2". There is no blur.
|
|
714
|
+
* The shadow takes no room in the layout, so it can run into the margin or a neighbor, and the
|
|
715
|
+
* siblings after the box are drawn over it. A box with no background shows the shadow only
|
|
716
|
+
* outside it. The box's own opacity fades the box and its shadow together.
|
|
717
|
+
*/
|
|
718
|
+
shadow?: string;
|
|
719
|
+
/**
|
|
720
|
+
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
721
|
+
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
722
|
+
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
723
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
724
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
725
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
726
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
727
|
+
*/
|
|
728
|
+
paginate?: string;
|
|
729
|
+
debug?: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
732
|
+
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
733
|
+
* line; in a column it takes the full width.
|
|
734
|
+
*/
|
|
735
|
+
width?: string;
|
|
736
|
+
/**
|
|
737
|
+
* How many columns a tab fills to: it moves the next character to the next multiple of this many
|
|
738
|
+
* characters from the start of the line. Default 4.
|
|
739
|
+
*/
|
|
740
|
+
tabSize?: number;
|
|
741
|
+
/**
|
|
742
|
+
* The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
|
|
743
|
+
* name from the line-height row of the tokens. Default 1.2, which is the token m.
|
|
744
|
+
*/
|
|
745
|
+
lineHeight?: string | number;
|
|
746
|
+
/**
|
|
747
|
+
* The fewest lines of the code that may stand alone at the top of the next page when it splits.
|
|
748
|
+
* Default 2. If fewer would be left, lines move from the first page to the next; 1 turns the
|
|
749
|
+
* protection off.
|
|
750
|
+
*/
|
|
751
|
+
widows?: number;
|
|
752
|
+
/**
|
|
753
|
+
* The fewest lines of the code that may stand alone at the bottom of a page when it splits.
|
|
754
|
+
* Default 2. If fewer would fit, the whole code moves to the next page; 1 turns the protection
|
|
755
|
+
* off.
|
|
756
|
+
*/
|
|
757
|
+
orphans?: number;
|
|
476
758
|
}
|
|
477
759
|
/**
|
|
478
760
|
* Attributes of the `td` element.
|
|
@@ -490,7 +772,8 @@ export interface TdAttr {
|
|
|
490
772
|
/**
|
|
491
773
|
* Space between the edge of the box and its content, written like CSS: one value for all sides,
|
|
492
774
|
* two for top-bottom and left-right, three for top, left-right and bottom, four for top, right,
|
|
493
|
-
* bottom and left.
|
|
775
|
+
* bottom and left. Each value is a length or a name from the space row of the tokens, and they
|
|
776
|
+
* can be mixed: 0pt 0pt 0pt m.
|
|
494
777
|
*/
|
|
495
778
|
padding?: string;
|
|
496
779
|
/**
|
|
@@ -508,7 +791,7 @@ export interface TdAttr {
|
|
|
508
791
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
509
792
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
510
793
|
*/
|
|
511
|
-
opacity?:
|
|
794
|
+
opacity?: number;
|
|
512
795
|
/**
|
|
513
796
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
514
797
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -522,12 +805,13 @@ export interface TdAttr {
|
|
|
522
805
|
* Where the box falls in the page flow. no: never split the box, and move it whole to the next
|
|
523
806
|
* page when it does not fit. break-before: start it on a new page. break-after: start the next
|
|
524
807
|
* sibling on a new page. keep-next: keep it on one page with the sibling that follows, moving
|
|
525
|
-
* both to the next page if that sibling would not fit
|
|
526
|
-
*
|
|
527
|
-
*
|
|
808
|
+
* both to the next page if that sibling would not fit and cannot start on this page: a table
|
|
809
|
+
* splits after its header and a row, and a text after a few lines, and then it stays with that
|
|
810
|
+
* first part. break-before, break-after and keep-next take effect on the children of layout; on a
|
|
811
|
+
* box inside another box they are not applied. no applies at any depth.
|
|
528
812
|
*/
|
|
529
813
|
paginate?: string;
|
|
530
|
-
debug?:
|
|
814
|
+
debug?: boolean;
|
|
531
815
|
/**
|
|
532
816
|
* How many of the table's columns the cell spans. It is as wide as those columns and the gaps
|
|
533
817
|
* between them, and the cells after it in the row start at the column after its last. A row whose
|
|
@@ -535,7 +819,7 @@ export interface TdAttr {
|
|
|
535
819
|
* last columns empty. It changes widths only: row heights and page breaks work as before. Default
|
|
536
820
|
* 1.
|
|
537
821
|
*/
|
|
538
|
-
colspan?:
|
|
822
|
+
colspan?: number;
|
|
539
823
|
/**
|
|
540
824
|
* How many rows the cell spans, its own included. It is as tall as those rows and the gaps
|
|
541
825
|
* between them, and the rows under it leave its columns out: their cells start at the first free
|
|
@@ -545,7 +829,7 @@ export interface TdAttr {
|
|
|
545
829
|
* spans stay on one page: the group moves to the next page whole when it does not fit, and one
|
|
546
830
|
* taller than a page is clipped at the page's end. Default 1.
|
|
547
831
|
*/
|
|
548
|
-
rowspan?:
|
|
832
|
+
rowspan?: number;
|
|
549
833
|
align?: string;
|
|
550
834
|
valign?: string;
|
|
551
835
|
}
|
|
@@ -575,11 +859,31 @@ export interface TrAttr {
|
|
|
575
859
|
*/
|
|
576
860
|
export interface TableAttr {
|
|
577
861
|
/**
|
|
578
|
-
* Column widths, separated by spaces, in fr, pt or % units: for example 2fr 1fr 120pt
|
|
862
|
+
* Column widths, separated by spaces, in fr, pt or % units, or auto: for example 2fr 1fr 120pt
|
|
863
|
+
* 20%. An auto column takes the width its cells need on one line, and the auto columns share what
|
|
864
|
+
* the pt and % columns leave, in proportion to what they need. When they do not fit, each keeps
|
|
865
|
+
* at least its longest word, and when not even those fit, the longest are cut and a short column
|
|
866
|
+
* keeps its width. auto and fr cannot be in one table: use pt or % for the fixed columns. For
|
|
867
|
+
* example auto 90pt 60pt.
|
|
579
868
|
*/
|
|
580
869
|
cols: string;
|
|
870
|
+
/**
|
|
871
|
+
* A grid: a line around every cell, as thickness and color, for example 1pt #cccccc.
|
|
872
|
+
*/
|
|
581
873
|
border?: string;
|
|
874
|
+
/** The background of every other row below the header, or none. */
|
|
582
875
|
stripe?: string;
|
|
876
|
+
/**
|
|
877
|
+
* The line under the header row, across the table, as thickness and color like border, or none:
|
|
878
|
+
* for example xs line.
|
|
879
|
+
*/
|
|
880
|
+
headBorder?: string;
|
|
881
|
+
/**
|
|
882
|
+
* The line under each row, across the table, as thickness and color like border, or none: for
|
|
883
|
+
* example xs line-muted. Under the header row, head-border takes its place when it is set. A line
|
|
884
|
+
* stops where a cell spans on into the next row.
|
|
885
|
+
*/
|
|
886
|
+
rowBorder?: string;
|
|
583
887
|
gap?: string;
|
|
584
888
|
padding?: string;
|
|
585
889
|
background?: string;
|
|
@@ -591,7 +895,7 @@ export interface TableAttr {
|
|
|
591
895
|
width?: string;
|
|
592
896
|
height?: string;
|
|
593
897
|
paginate?: string;
|
|
594
|
-
debug?:
|
|
898
|
+
debug?: boolean;
|
|
595
899
|
}
|
|
596
900
|
/**
|
|
597
901
|
* Attributes of the `field` element.
|
|
@@ -603,10 +907,10 @@ export interface FieldAttr {
|
|
|
603
907
|
label?: string;
|
|
604
908
|
options?: string;
|
|
605
909
|
group?: string;
|
|
606
|
-
checked?:
|
|
607
|
-
required?:
|
|
608
|
-
readonly?:
|
|
609
|
-
maxLen?:
|
|
910
|
+
checked?: boolean;
|
|
911
|
+
required?: boolean;
|
|
912
|
+
readonly?: boolean;
|
|
913
|
+
maxLen?: number;
|
|
610
914
|
actionUrl?: string;
|
|
611
915
|
/**
|
|
612
916
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
@@ -617,7 +921,7 @@ export interface FieldAttr {
|
|
|
617
921
|
height?: string;
|
|
618
922
|
background?: string;
|
|
619
923
|
border?: string;
|
|
620
|
-
debug?:
|
|
924
|
+
debug?: boolean;
|
|
621
925
|
}
|
|
622
926
|
/**
|
|
623
927
|
* An entry of the PDF's outline, the bookmark panel of a viewer, and a target for links with
|
|
@@ -632,7 +936,7 @@ export interface BookmarkAttr {
|
|
|
632
936
|
* Depth in the outline, 1 to 6. Defaults to 1. An entry nests under the closest entry before it
|
|
633
937
|
* with a lower level.
|
|
634
938
|
*/
|
|
635
|
-
level?:
|
|
939
|
+
level?: number;
|
|
636
940
|
/**
|
|
637
941
|
* The name links use to jump here, as href="#id". Leave it out to make it from the label:
|
|
638
942
|
* lowercase, with other characters than letters and digits turned into hyphens, and -2, -3 added
|
|
@@ -658,7 +962,296 @@ export interface RegionAttr {
|
|
|
658
962
|
*/
|
|
659
963
|
page?: string;
|
|
660
964
|
w?: string;
|
|
661
|
-
debug?:
|
|
965
|
+
debug?: boolean;
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Markdown as the content of a section, where a layout would go. It holds only Markdown: optional
|
|
969
|
+
* markdown-styles, which say how each part of it looks, and one markdown-content, which holds the
|
|
970
|
+
* text. The page, a header, a footer or a cover are not Markdown, so they stay in the XML: layers
|
|
971
|
+
* paint a header and a footer in the margin, and a cover or a table of contents is a section of its
|
|
972
|
+
* own. CommonMark with tables, strikethrough and footnotes, and a $ is text. Raw HTML is for an
|
|
973
|
+
* HTML output, which a PDF is not, so a tag is left out and the words in it are kept: a block such
|
|
974
|
+
* as a p or a div puts the words around it on lines of their own. Two tags are read: br breaks a
|
|
975
|
+
* line, and img shows an image, at its width and height in pixels when it has them, which
|
|
976
|
+
* Markdown's own image has no way to say. An image at a URL, in Markdown or in an img, is left out,
|
|
977
|
+
* since an image must be an asset. A heading is a bookmark, so the table of contents and the
|
|
978
|
+
* outline of the viewer fill themselves.
|
|
979
|
+
*/
|
|
980
|
+
export interface MarkdownAttr {
|
|
981
|
+
/**
|
|
982
|
+
* The space between the page edges and the Markdown: one value for all four sides, or two to four
|
|
983
|
+
* in the order top, right, bottom, left. Defaults to 36pt. A layer draws a header or a footer in
|
|
984
|
+
* it.
|
|
985
|
+
*/
|
|
986
|
+
margin?: string;
|
|
987
|
+
/** The font of the Markdown, which a rule can change. Defaults to the document's. */
|
|
988
|
+
font?: string;
|
|
989
|
+
/** The size of the text of the Markdown, which a rule can change. Defaults to 11pt. */
|
|
990
|
+
fontSize?: string;
|
|
991
|
+
/**
|
|
992
|
+
* The color of the text of the Markdown, which a rule can change. Defaults to the text token.
|
|
993
|
+
*/
|
|
994
|
+
color?: string;
|
|
995
|
+
/**
|
|
996
|
+
* The space between the blocks: headings, paragraphs, lists, code, quotes, tables and images.
|
|
997
|
+
* Default none.
|
|
998
|
+
*/
|
|
999
|
+
gap?: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* How many levels of headings become bookmarks, for the outline of the viewer and the table of
|
|
1002
|
+
* contents: n keeps the levels 1 to n, 0 none. Default 6.
|
|
1003
|
+
*/
|
|
1004
|
+
bookmarks?: number;
|
|
1005
|
+
debug?: boolean;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* How the parts of the Markdown look. A rule is named after the Markdown it styles and takes the
|
|
1009
|
+
* attributes of the element it becomes, so that h1 takes what a text takes. A rule here overrides
|
|
1010
|
+
* the same rule of the file that src names, which overrides the defaults: a style that is not set
|
|
1011
|
+
* stays what it was. Values are the tokens' (font-size="xxl", color="primary") or plain lengths and
|
|
1012
|
+
* colors, and fonts are names from assets. A built-in font needs no rule for italic and bold; an
|
|
1013
|
+
* embedded font names the faces: em font="body-italic", strong font="body-bold".
|
|
1014
|
+
*/
|
|
1015
|
+
export interface MarkdownStylesAttr {
|
|
1016
|
+
/**
|
|
1017
|
+
* A file of rules, whose root is a markdown-styles. The rules written here override its rules.
|
|
1018
|
+
* The engine reads no files: the SDK, the command line or the extension reads it, as it reads the
|
|
1019
|
+
* src of a font or an image.
|
|
1020
|
+
*/
|
|
1021
|
+
src?: string;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* A heading of level 1, written # in Markdown.
|
|
1025
|
+
*/
|
|
1026
|
+
export interface MarkdownH1Attr {
|
|
1027
|
+
font?: string;
|
|
1028
|
+
fontSize?: string;
|
|
1029
|
+
bold?: boolean;
|
|
1030
|
+
color?: string;
|
|
1031
|
+
align?: string;
|
|
1032
|
+
lineHeight?: string | number;
|
|
1033
|
+
padding?: string;
|
|
1034
|
+
background?: string;
|
|
1035
|
+
border?: string;
|
|
1036
|
+
radius?: string;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* A heading of level 2, written ## in Markdown.
|
|
1040
|
+
*/
|
|
1041
|
+
export interface MarkdownH2Attr {
|
|
1042
|
+
font?: string;
|
|
1043
|
+
fontSize?: string;
|
|
1044
|
+
bold?: boolean;
|
|
1045
|
+
color?: string;
|
|
1046
|
+
align?: string;
|
|
1047
|
+
lineHeight?: string | number;
|
|
1048
|
+
padding?: string;
|
|
1049
|
+
background?: string;
|
|
1050
|
+
border?: string;
|
|
1051
|
+
radius?: string;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* A heading of level 3, written ### in Markdown.
|
|
1055
|
+
*/
|
|
1056
|
+
export interface MarkdownH3Attr {
|
|
1057
|
+
font?: string;
|
|
1058
|
+
fontSize?: string;
|
|
1059
|
+
bold?: boolean;
|
|
1060
|
+
color?: string;
|
|
1061
|
+
align?: string;
|
|
1062
|
+
lineHeight?: string | number;
|
|
1063
|
+
padding?: string;
|
|
1064
|
+
background?: string;
|
|
1065
|
+
border?: string;
|
|
1066
|
+
radius?: string;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* A heading of level 4, written #### in Markdown.
|
|
1070
|
+
*/
|
|
1071
|
+
export interface MarkdownH4Attr {
|
|
1072
|
+
font?: string;
|
|
1073
|
+
fontSize?: string;
|
|
1074
|
+
bold?: boolean;
|
|
1075
|
+
color?: string;
|
|
1076
|
+
align?: string;
|
|
1077
|
+
lineHeight?: string | number;
|
|
1078
|
+
padding?: string;
|
|
1079
|
+
background?: string;
|
|
1080
|
+
border?: string;
|
|
1081
|
+
radius?: string;
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* A heading of level 5, written ##### in Markdown.
|
|
1085
|
+
*/
|
|
1086
|
+
export interface MarkdownH5Attr {
|
|
1087
|
+
font?: string;
|
|
1088
|
+
fontSize?: string;
|
|
1089
|
+
bold?: boolean;
|
|
1090
|
+
color?: string;
|
|
1091
|
+
align?: string;
|
|
1092
|
+
lineHeight?: string | number;
|
|
1093
|
+
padding?: string;
|
|
1094
|
+
background?: string;
|
|
1095
|
+
border?: string;
|
|
1096
|
+
radius?: string;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* A heading of level 6, written ###### in Markdown.
|
|
1100
|
+
*/
|
|
1101
|
+
export interface MarkdownH6Attr {
|
|
1102
|
+
font?: string;
|
|
1103
|
+
fontSize?: string;
|
|
1104
|
+
bold?: boolean;
|
|
1105
|
+
color?: string;
|
|
1106
|
+
align?: string;
|
|
1107
|
+
lineHeight?: string | number;
|
|
1108
|
+
padding?: string;
|
|
1109
|
+
background?: string;
|
|
1110
|
+
border?: string;
|
|
1111
|
+
radius?: string;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* A paragraph, and the words of a list item, a quote and a footnote.
|
|
1115
|
+
*/
|
|
1116
|
+
export interface MarkdownPAttr {
|
|
1117
|
+
font?: string;
|
|
1118
|
+
fontSize?: string;
|
|
1119
|
+
bold?: boolean;
|
|
1120
|
+
color?: string;
|
|
1121
|
+
align?: string;
|
|
1122
|
+
lineHeight?: string | number;
|
|
1123
|
+
padding?: string;
|
|
1124
|
+
background?: string;
|
|
1125
|
+
border?: string;
|
|
1126
|
+
radius?: string;
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Code: the box of a fenced or indented block, and the run of inline code, which takes the font,
|
|
1130
|
+
* the color and the background. The language of a fence is ignored, since there is no highlighting
|
|
1131
|
+
* by language.
|
|
1132
|
+
*/
|
|
1133
|
+
export interface MarkdownCodeAttr {
|
|
1134
|
+
font?: string;
|
|
1135
|
+
fontSize?: string;
|
|
1136
|
+
color?: string;
|
|
1137
|
+
lineHeight?: string | number;
|
|
1138
|
+
padding?: string;
|
|
1139
|
+
background?: string;
|
|
1140
|
+
border?: string;
|
|
1141
|
+
radius?: string;
|
|
1142
|
+
tabSize?: number;
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* A block quote, written > in Markdown: a bar beside its content. font, font-size, color,
|
|
1146
|
+
* line-height and align set the words; padding, background, border and radius the box around the
|
|
1147
|
+
* bar and the words; bar-color and bar-width the bar, a strip along the left of the box: bar-width
|
|
1148
|
+
* is a length or a name from the space row of the tokens.
|
|
1149
|
+
*/
|
|
1150
|
+
export interface MarkdownQuoteAttr {
|
|
1151
|
+
font?: string;
|
|
1152
|
+
fontSize?: string;
|
|
1153
|
+
bold?: boolean;
|
|
1154
|
+
color?: string;
|
|
1155
|
+
align?: string;
|
|
1156
|
+
lineHeight?: string | number;
|
|
1157
|
+
padding?: string;
|
|
1158
|
+
background?: string;
|
|
1159
|
+
border?: string;
|
|
1160
|
+
radius?: string;
|
|
1161
|
+
barColor?: string;
|
|
1162
|
+
barWidth?: string;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* An item of a bullet or a numbered list. indent is the width of the marker's column and bullet the
|
|
1166
|
+
* shape of a bullet list's marker, as on a list; gap goes between the blocks of an item.
|
|
1167
|
+
*/
|
|
1168
|
+
export interface MarkdownLiAttr {
|
|
1169
|
+
font?: string;
|
|
1170
|
+
fontSize?: string;
|
|
1171
|
+
color?: string;
|
|
1172
|
+
gap?: string;
|
|
1173
|
+
padding?: string;
|
|
1174
|
+
background?: string;
|
|
1175
|
+
border?: string;
|
|
1176
|
+
indent?: string;
|
|
1177
|
+
bullet?: string;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* A link, written [text](url) in Markdown.
|
|
1181
|
+
*/
|
|
1182
|
+
export interface MarkdownAAttr {
|
|
1183
|
+
font?: string;
|
|
1184
|
+
color?: string;
|
|
1185
|
+
bold?: boolean;
|
|
1186
|
+
underline?: boolean;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Strong text, written **text** in Markdown. Bold in a built-in font; an embedded font names its
|
|
1190
|
+
* bold face in font.
|
|
1191
|
+
*/
|
|
1192
|
+
export interface MarkdownStrongAttr {
|
|
1193
|
+
font?: string;
|
|
1194
|
+
color?: string;
|
|
1195
|
+
bold?: boolean;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Emphasis, written *text* in Markdown. Italic in a built-in font; an embedded font names its
|
|
1199
|
+
* italic face in font.
|
|
1200
|
+
*/
|
|
1201
|
+
export interface MarkdownEmAttr {
|
|
1202
|
+
font?: string;
|
|
1203
|
+
color?: string;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Struck-through text, written ~~text~~ in Markdown.
|
|
1207
|
+
*/
|
|
1208
|
+
export interface MarkdownDelAttr {
|
|
1209
|
+
font?: string;
|
|
1210
|
+
color?: string;
|
|
1211
|
+
strike?: boolean;
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* A table. Its columns are sized by their content: a column takes the width its cells need on one
|
|
1215
|
+
* line, the room that is left is shared in proportion, and a name that does not fit breaks at the
|
|
1216
|
+
* edge of its cell. stripe is the color of every other row, or none; head-border is the line under
|
|
1217
|
+
* the header row and row-border the line under each of the other rows, as thickness and color like
|
|
1218
|
+
* border, or none. The default styles draw a line in line-muted under the header and under each
|
|
1219
|
+
* row, with no stripe.
|
|
1220
|
+
*/
|
|
1221
|
+
export interface MarkdownTableAttr {
|
|
1222
|
+
border?: string;
|
|
1223
|
+
stripe?: string;
|
|
1224
|
+
headBorder?: string;
|
|
1225
|
+
rowBorder?: string;
|
|
1226
|
+
gap?: string;
|
|
1227
|
+
padding?: string;
|
|
1228
|
+
background?: string;
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* A cell of a table's header row.
|
|
1232
|
+
*/
|
|
1233
|
+
export interface MarkdownThAttr {
|
|
1234
|
+
font?: string;
|
|
1235
|
+
fontSize?: string;
|
|
1236
|
+
bold?: boolean;
|
|
1237
|
+
color?: string;
|
|
1238
|
+
align?: string;
|
|
1239
|
+
padding?: string;
|
|
1240
|
+
background?: string;
|
|
1241
|
+
border?: string;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* A cell of a table's other rows.
|
|
1245
|
+
*/
|
|
1246
|
+
export interface MarkdownTdAttr {
|
|
1247
|
+
font?: string;
|
|
1248
|
+
fontSize?: string;
|
|
1249
|
+
bold?: boolean;
|
|
1250
|
+
color?: string;
|
|
1251
|
+
align?: string;
|
|
1252
|
+
padding?: string;
|
|
1253
|
+
background?: string;
|
|
1254
|
+
border?: string;
|
|
662
1255
|
}
|
|
663
1256
|
/**
|
|
664
1257
|
* Draws shapes, text, images and barcodes at exact positions on the page, independent of the
|
|
@@ -674,7 +1267,7 @@ export interface LayerAttr {
|
|
|
674
1267
|
* How opaque everything in the layer is, from 0 to 1. To fade one element, put it in a layer of
|
|
675
1268
|
* its own.
|
|
676
1269
|
*/
|
|
677
|
-
opacity?:
|
|
1270
|
+
opacity?: number;
|
|
678
1271
|
transform?: string;
|
|
679
1272
|
/**
|
|
680
1273
|
* A rectangle that cuts off what the layer draws outside it: x y w h, in points from the top left
|
|
@@ -822,28 +1415,28 @@ export interface TextAtAttr {
|
|
|
822
1415
|
* Helvetica-Bold, Times-Roman becomes Times-Bold, Courier becomes Courier-Bold, and the oblique
|
|
823
1416
|
* and italic faces their bold forms. A custom font has no bold face to pick, so name one in font.
|
|
824
1417
|
*/
|
|
825
|
-
bold?:
|
|
1418
|
+
bold?: boolean;
|
|
826
1419
|
color?: string;
|
|
827
1420
|
align?: string;
|
|
828
1421
|
/**
|
|
829
1422
|
* The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
|
|
830
1423
|
* name from the line-height row of the tokens. Default 1.2, which is the token m.
|
|
831
1424
|
*/
|
|
832
|
-
lineHeight?: string;
|
|
1425
|
+
lineHeight?: string | number;
|
|
833
1426
|
/**
|
|
834
1427
|
* The most lines drawn. Only whole lines are drawn, and the rest of the text is dropped. A text
|
|
835
1428
|
* in the layout has no cap by default and wraps at the width it has; the lines it drops take no
|
|
836
1429
|
* room, and a text that splits across pages keeps the cap across them. A text-at is one line by
|
|
837
1430
|
* default, and above 1 needs a width to wrap within.
|
|
838
1431
|
*/
|
|
839
|
-
maxLines?:
|
|
1432
|
+
maxLines?: number;
|
|
840
1433
|
/**
|
|
841
1434
|
* End the last line drawn in an ellipsis when max-lines drops text, shortened to fit the width.
|
|
842
1435
|
* Off by default: the text stops at the end of a line. A text-at also ends a line in one when it
|
|
843
1436
|
* is cut off at its width. A text in the layout without max-lines is never cut, so there it has
|
|
844
1437
|
* no effect.
|
|
845
1438
|
*/
|
|
846
|
-
ellipsis?:
|
|
1439
|
+
ellipsis?: boolean;
|
|
847
1440
|
/**
|
|
848
1441
|
* Width of the box. Without it the text is one line of the width its characters need, and align
|
|
849
1442
|
* has no effect; a long text runs on past the edge of the page, which cuts it off, but stays in
|
|
@@ -888,7 +1481,7 @@ export interface BarcodeAtAttr {
|
|
|
888
1481
|
*/
|
|
889
1482
|
height?: string;
|
|
890
1483
|
ec?: string;
|
|
891
|
-
hrt?:
|
|
1484
|
+
hrt?: boolean;
|
|
892
1485
|
color?: string;
|
|
893
1486
|
background?: string;
|
|
894
1487
|
x?: string;
|
|
@@ -945,3 +1538,78 @@ export interface ImageAttr {
|
|
|
945
1538
|
*/
|
|
946
1539
|
src?: string;
|
|
947
1540
|
}
|
|
1541
|
+
/**
|
|
1542
|
+
* A file the PDF carries, under the name a reader shows. The SDK reads it from src, or it was
|
|
1543
|
+
* loaded on the engine under ref or, with no ref, under its own name. A file with no bytes is an
|
|
1544
|
+
* error, and so are two files with the same name.
|
|
1545
|
+
*/
|
|
1546
|
+
export interface FileAttr {
|
|
1547
|
+
/**
|
|
1548
|
+
* The name a reader shows the file under and saves it as, such as invoice.xml. Each file of the
|
|
1549
|
+
* document has a name of its own.
|
|
1550
|
+
*/
|
|
1551
|
+
name: string;
|
|
1552
|
+
/** A path the SDK reads the file from, when the file was not loaded on the engine. */
|
|
1553
|
+
src?: string;
|
|
1554
|
+
/** The key the file was loaded under on the engine, when that is not its name. */
|
|
1555
|
+
ref?: string;
|
|
1556
|
+
/**
|
|
1557
|
+
* The type of the file, such as text/xml, application/pdf or text/csv. Defaults to
|
|
1558
|
+
* application/octet-stream, which says only that it is a file.
|
|
1559
|
+
*/
|
|
1560
|
+
mime?: string;
|
|
1561
|
+
/**
|
|
1562
|
+
* How the file relates to the document: source, data, alternative, supplement or unspecified, the
|
|
1563
|
+
* default. An e-invoice's XML is data.
|
|
1564
|
+
*/
|
|
1565
|
+
relationship?: string;
|
|
1566
|
+
/** A line about the file, which a reader shows beside its name. */
|
|
1567
|
+
description?: string;
|
|
1568
|
+
}
|
|
1569
|
+
/**
|
|
1570
|
+
* One color of a gradient, at an offset along it.
|
|
1571
|
+
*/
|
|
1572
|
+
export interface GradientStop {
|
|
1573
|
+
/**
|
|
1574
|
+
* Where the color is reached along the gradient, from 0% (the start) to 100% (the end). Stops go
|
|
1575
|
+
* in increasing order.
|
|
1576
|
+
*/
|
|
1577
|
+
offset: string;
|
|
1578
|
+
/**
|
|
1579
|
+
* The color at the stop: hex, cmyk(), rgb(), hsl() or a color token. The stops of a gradient are
|
|
1580
|
+
* all CMYK or all RGB.
|
|
1581
|
+
*/
|
|
1582
|
+
color: string;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* A named blend of colors. A background or a fill uses it as gradient:name, and the blend spans the
|
|
1586
|
+
* box it fills. Give from and to for two colors, or stop children for more.
|
|
1587
|
+
*/
|
|
1588
|
+
export interface GradientToken {
|
|
1589
|
+
/**
|
|
1590
|
+
* linear runs along a line across the box. radial runs from the center out to the farthest
|
|
1591
|
+
* corner.
|
|
1592
|
+
*/
|
|
1593
|
+
type: 'linear' | 'radial';
|
|
1594
|
+
/**
|
|
1595
|
+
* The first color: hex, cmyk(), rgb(), hsl() or a color token, CMYK if to is and RGB if it is
|
|
1596
|
+
* not. Used with to, when there are no stop children. For a radial gradient it is the center.
|
|
1597
|
+
*/
|
|
1598
|
+
from?: string;
|
|
1599
|
+
/**
|
|
1600
|
+
* The last color: hex, cmyk(), rgb(), hsl() or a color token. Used with from, when there are no
|
|
1601
|
+
* stop children. For a radial gradient it is the edge.
|
|
1602
|
+
*/
|
|
1603
|
+
to?: string;
|
|
1604
|
+
/**
|
|
1605
|
+
* The direction of a linear gradient, in degrees: 0 runs from the top to the bottom, 90 from the
|
|
1606
|
+
* left to the right, 180 from the bottom to the top. Default 0. A radial gradient has no
|
|
1607
|
+
* direction.
|
|
1608
|
+
*/
|
|
1609
|
+
angle?: number;
|
|
1610
|
+
/**
|
|
1611
|
+
* The colors of the gradient, for more than two: each at an offset, in increasing order. Give
|
|
1612
|
+
* these, or from and to.
|
|
1613
|
+
*/
|
|
1614
|
+
stops?: GradientStop[];
|
|
1615
|
+
}
|