@lpdfio/lpdf 0.30.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/_shared.d.ts +42 -3
- package/dist/_shared.js +52 -3
- package/dist/attrs.d.ts +157 -82
- package/dist/browser.js +105 -61
- package/dist/canvas.d.ts +10 -9
- package/dist/constants.d.ts +27 -0
- package/dist/constants.js +25 -1
- package/dist/engine.d.ts +12 -42
- package/dist/engine.js +85 -47
- package/dist/index.d.ts +3 -4
- package/dist/index.js +4 -1
- package/dist/kit.d.ts +45 -30
- package/dist/kit.js +7 -1
- package/dist/layout.d.ts +20 -19
- package/dist/markdown.d.ts +5 -4
- package/dist/wasm/lpdf-web.js +51 -50
- package/dist/wasm/lpdf.js +51 -50
- package/dist/wasm/lpdf_bg.wasm +0 -0
- package/package.json +1 -1
package/dist/attrs.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface ColumnAttr {
|
|
|
34
34
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
35
35
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
36
36
|
*/
|
|
37
|
-
opacity?:
|
|
37
|
+
opacity?: number;
|
|
38
38
|
/**
|
|
39
39
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
40
40
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -54,7 +54,7 @@ export interface ColumnAttr {
|
|
|
54
54
|
* box inside another box they are not applied. no applies at any depth.
|
|
55
55
|
*/
|
|
56
56
|
paginate?: string;
|
|
57
|
-
debug?:
|
|
57
|
+
debug?: boolean;
|
|
58
58
|
align?: string;
|
|
59
59
|
justify?: string;
|
|
60
60
|
/**
|
|
@@ -102,7 +102,7 @@ export interface RowAttr {
|
|
|
102
102
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
103
103
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
104
104
|
*/
|
|
105
|
-
opacity?:
|
|
105
|
+
opacity?: number;
|
|
106
106
|
/**
|
|
107
107
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
108
108
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -122,7 +122,7 @@ export interface RowAttr {
|
|
|
122
122
|
* box inside another box they are not applied. no applies at any depth.
|
|
123
123
|
*/
|
|
124
124
|
paginate?: string;
|
|
125
|
-
debug?:
|
|
125
|
+
debug?: boolean;
|
|
126
126
|
align?: string;
|
|
127
127
|
justify?: string;
|
|
128
128
|
/**
|
|
@@ -168,7 +168,7 @@ export interface GridAttr {
|
|
|
168
168
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
169
169
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
170
170
|
*/
|
|
171
|
-
opacity?:
|
|
171
|
+
opacity?: number;
|
|
172
172
|
/**
|
|
173
173
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
174
174
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -188,7 +188,7 @@ export interface GridAttr {
|
|
|
188
188
|
* box inside another box they are not applied. no applies at any depth.
|
|
189
189
|
*/
|
|
190
190
|
paginate?: string;
|
|
191
|
-
debug?:
|
|
191
|
+
debug?: boolean;
|
|
192
192
|
/**
|
|
193
193
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
194
194
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -196,7 +196,7 @@ export interface GridAttr {
|
|
|
196
196
|
*/
|
|
197
197
|
width?: string;
|
|
198
198
|
colWidth?: string;
|
|
199
|
-
cols?:
|
|
199
|
+
cols?: number;
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
202
|
* A list of items, each with a marker: a bullet drawn as a shape, or a number the engine gives. The
|
|
@@ -236,7 +236,7 @@ export interface ListAttr {
|
|
|
236
236
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
237
237
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
238
238
|
*/
|
|
239
|
-
opacity?:
|
|
239
|
+
opacity?: number;
|
|
240
240
|
/**
|
|
241
241
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
242
242
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -256,7 +256,7 @@ export interface ListAttr {
|
|
|
256
256
|
* box inside another box they are not applied. no applies at any depth.
|
|
257
257
|
*/
|
|
258
258
|
paginate?: string;
|
|
259
|
-
debug?:
|
|
259
|
+
debug?: boolean;
|
|
260
260
|
/** bullet marks each item with a shape, number with a number. Default bullet. */
|
|
261
261
|
type?: string;
|
|
262
262
|
/**
|
|
@@ -270,7 +270,7 @@ export interface ListAttr {
|
|
|
270
270
|
* The number of a number list's first item, to continue a list that something cut in two. Default
|
|
271
271
|
* 1.
|
|
272
272
|
*/
|
|
273
|
-
start?:
|
|
273
|
+
start?: number;
|
|
274
274
|
/**
|
|
275
275
|
* Text before each number of a number list: prefix="(" and suffix=")" write (a). Default none.
|
|
276
276
|
*/
|
|
@@ -338,7 +338,7 @@ export interface LiAttr {
|
|
|
338
338
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
339
339
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
340
340
|
*/
|
|
341
|
-
opacity?:
|
|
341
|
+
opacity?: number;
|
|
342
342
|
/**
|
|
343
343
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
344
344
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -358,7 +358,7 @@ export interface LiAttr {
|
|
|
358
358
|
* box inside another box they are not applied. no applies at any depth.
|
|
359
359
|
*/
|
|
360
360
|
paginate?: string;
|
|
361
|
-
debug?:
|
|
361
|
+
debug?: boolean;
|
|
362
362
|
/**
|
|
363
363
|
* Makes the item's marker a checkbox in place of the bullet or the number: an outline in the line
|
|
364
364
|
* color, with a tick in the color of the item's words when this is true, and empty when it is
|
|
@@ -366,7 +366,7 @@ export interface LiAttr {
|
|
|
366
366
|
* number. An item without it keeps its bullet or number. A task item of a Markdown, - [ ] or -
|
|
367
367
|
* [x], is one.
|
|
368
368
|
*/
|
|
369
|
-
checked?:
|
|
369
|
+
checked?: boolean;
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
372
|
* A box around a single child, which it centres. Never splits across pages: if it does not fit, the
|
|
@@ -403,7 +403,7 @@ export interface FrameAttr {
|
|
|
403
403
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
404
404
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
405
405
|
*/
|
|
406
|
-
opacity?:
|
|
406
|
+
opacity?: number;
|
|
407
407
|
/**
|
|
408
408
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
409
409
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -423,7 +423,7 @@ export interface FrameAttr {
|
|
|
423
423
|
* box inside another box they are not applied. no applies at any depth.
|
|
424
424
|
*/
|
|
425
425
|
paginate?: string;
|
|
426
|
-
debug?:
|
|
426
|
+
debug?: boolean;
|
|
427
427
|
/**
|
|
428
428
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
429
429
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -448,7 +448,7 @@ export interface LinkAttr {
|
|
|
448
448
|
*/
|
|
449
449
|
width?: string;
|
|
450
450
|
height?: string;
|
|
451
|
-
debug?:
|
|
451
|
+
debug?: boolean;
|
|
452
452
|
}
|
|
453
453
|
/**
|
|
454
454
|
* Attributes of the `divider` element.
|
|
@@ -463,22 +463,22 @@ export interface DividerAttr {
|
|
|
463
463
|
* line; in a column it takes the full width.
|
|
464
464
|
*/
|
|
465
465
|
width?: string;
|
|
466
|
-
debug?:
|
|
466
|
+
debug?: boolean;
|
|
467
467
|
}
|
|
468
468
|
/**
|
|
469
469
|
* Attributes of the `span` element.
|
|
470
470
|
*/
|
|
471
471
|
export interface SpanAttr {
|
|
472
472
|
font?: string;
|
|
473
|
-
bold?:
|
|
473
|
+
bold?: boolean;
|
|
474
474
|
color?: string;
|
|
475
475
|
/**
|
|
476
476
|
* Makes the span a link: a URL, or #id to jump to the bookmark with that id. In an entry of a
|
|
477
477
|
* table of contents, # alone jumps to that entry's bookmark.
|
|
478
478
|
*/
|
|
479
479
|
href?: string;
|
|
480
|
-
underline?:
|
|
481
|
-
strike?:
|
|
480
|
+
underline?: boolean;
|
|
481
|
+
strike?: boolean;
|
|
482
482
|
}
|
|
483
483
|
/**
|
|
484
484
|
* A run of code inside a text: its words in Courier on a light tint, the tint drawn behind them. It
|
|
@@ -516,7 +516,7 @@ export interface ImgAttr {
|
|
|
516
516
|
border?: string;
|
|
517
517
|
radius?: string;
|
|
518
518
|
paginate?: string;
|
|
519
|
-
debug?:
|
|
519
|
+
debug?: boolean;
|
|
520
520
|
}
|
|
521
521
|
/**
|
|
522
522
|
* A rectangle, a circle or an ellipse in the layout, for a status dot, a color swatch or a progress
|
|
@@ -547,8 +547,8 @@ export interface ShapeAttr {
|
|
|
547
547
|
strokeWidth?: string;
|
|
548
548
|
strokeDash?: string;
|
|
549
549
|
/** How opaque the shape is, from 0 to 1. Default 1. */
|
|
550
|
-
opacity?:
|
|
551
|
-
debug?:
|
|
550
|
+
opacity?: number;
|
|
551
|
+
debug?: boolean;
|
|
552
552
|
}
|
|
553
553
|
/**
|
|
554
554
|
* A QR code, a Code 128 or an EAN-13. It is never stretched. With only a width or a height, the
|
|
@@ -571,7 +571,7 @@ export interface BarcodeAttr {
|
|
|
571
571
|
*/
|
|
572
572
|
height?: string;
|
|
573
573
|
ec?: string;
|
|
574
|
-
hrt?:
|
|
574
|
+
hrt?: boolean;
|
|
575
575
|
color?: string;
|
|
576
576
|
background?: string;
|
|
577
577
|
/**
|
|
@@ -581,7 +581,7 @@ export interface BarcodeAttr {
|
|
|
581
581
|
*/
|
|
582
582
|
width?: string;
|
|
583
583
|
paginate?: string;
|
|
584
|
-
debug?:
|
|
584
|
+
debug?: boolean;
|
|
585
585
|
}
|
|
586
586
|
/**
|
|
587
587
|
* A block of wrapping text. Use span children to style parts of it, and fn children for footnotes.
|
|
@@ -595,28 +595,28 @@ export interface TextAttr {
|
|
|
595
595
|
* Helvetica-Bold, Times-Roman becomes Times-Bold, Courier becomes Courier-Bold, and the oblique
|
|
596
596
|
* and italic faces their bold forms. A custom font has no bold face to pick, so name one in font.
|
|
597
597
|
*/
|
|
598
|
-
bold?:
|
|
598
|
+
bold?: boolean;
|
|
599
599
|
color?: string;
|
|
600
600
|
align?: string;
|
|
601
601
|
/**
|
|
602
602
|
* The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
|
|
603
603
|
* name from the line-height row of the tokens. Default 1.2, which is the token m.
|
|
604
604
|
*/
|
|
605
|
-
lineHeight?: string;
|
|
605
|
+
lineHeight?: string | number;
|
|
606
606
|
/**
|
|
607
607
|
* The most lines drawn. Only whole lines are drawn, and the rest of the text is dropped. A text
|
|
608
608
|
* in the layout has no cap by default and wraps at the width it has; the lines it drops take no
|
|
609
609
|
* room, and a text that splits across pages keeps the cap across them. A text-at is one line by
|
|
610
610
|
* default, and above 1 needs a width to wrap within.
|
|
611
611
|
*/
|
|
612
|
-
maxLines?:
|
|
612
|
+
maxLines?: number;
|
|
613
613
|
/**
|
|
614
614
|
* End the last line drawn in an ellipsis when max-lines drops text, shortened to fit the width.
|
|
615
615
|
* Off by default: the text stops at the end of a line. A text-at also ends a line in one when it
|
|
616
616
|
* is cut off at its width. A text in the layout without max-lines is never cut, so there it has
|
|
617
617
|
* no effect.
|
|
618
618
|
*/
|
|
619
|
-
ellipsis?:
|
|
619
|
+
ellipsis?: boolean;
|
|
620
620
|
/**
|
|
621
621
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
622
622
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -628,14 +628,14 @@ export interface TextAttr {
|
|
|
628
628
|
* Default 2. If fewer would be left, lines move from the first page to the next; 1 turns the
|
|
629
629
|
* protection off.
|
|
630
630
|
*/
|
|
631
|
-
widows?:
|
|
631
|
+
widows?: number;
|
|
632
632
|
/**
|
|
633
633
|
* The fewest lines of the text that may stand alone at the bottom of a page when it splits.
|
|
634
634
|
* Default 2. If fewer would fit, the whole text moves to the next page; 1 turns the protection
|
|
635
635
|
* off. When no split can keep both widows and orphans, even on an empty page, the text splits
|
|
636
636
|
* where the lines fit.
|
|
637
637
|
*/
|
|
638
|
-
orphans?:
|
|
638
|
+
orphans?: number;
|
|
639
639
|
/**
|
|
640
640
|
* Records the words of this text under a name as the pages are filled, so a text with capture-ref
|
|
641
641
|
* in a header or a footer can show them. Put it on a heading in the flow. The page that holds the
|
|
@@ -662,7 +662,7 @@ export interface TextAttr {
|
|
|
662
662
|
*/
|
|
663
663
|
captureFallback?: string;
|
|
664
664
|
paginate?: string;
|
|
665
|
-
debug?:
|
|
665
|
+
debug?: boolean;
|
|
666
666
|
}
|
|
667
667
|
/**
|
|
668
668
|
* Code, or any text whose spaces and lines matter, in a box. The text is kept as it is written:
|
|
@@ -706,7 +706,7 @@ export interface CodeAttr {
|
|
|
706
706
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
707
707
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
708
708
|
*/
|
|
709
|
-
opacity?:
|
|
709
|
+
opacity?: number;
|
|
710
710
|
/**
|
|
711
711
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
712
712
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -726,7 +726,7 @@ export interface CodeAttr {
|
|
|
726
726
|
* box inside another box they are not applied. no applies at any depth.
|
|
727
727
|
*/
|
|
728
728
|
paginate?: string;
|
|
729
|
-
debug?:
|
|
729
|
+
debug?: boolean;
|
|
730
730
|
/**
|
|
731
731
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
732
732
|
* the other children, shared equally if several on the line use fill, and never moves to the next
|
|
@@ -737,24 +737,24 @@ export interface CodeAttr {
|
|
|
737
737
|
* How many columns a tab fills to: it moves the next character to the next multiple of this many
|
|
738
738
|
* characters from the start of the line. Default 4.
|
|
739
739
|
*/
|
|
740
|
-
tabSize?:
|
|
740
|
+
tabSize?: number;
|
|
741
741
|
/**
|
|
742
742
|
* The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
|
|
743
743
|
* name from the line-height row of the tokens. Default 1.2, which is the token m.
|
|
744
744
|
*/
|
|
745
|
-
lineHeight?: string;
|
|
745
|
+
lineHeight?: string | number;
|
|
746
746
|
/**
|
|
747
747
|
* The fewest lines of the code that may stand alone at the top of the next page when it splits.
|
|
748
748
|
* Default 2. If fewer would be left, lines move from the first page to the next; 1 turns the
|
|
749
749
|
* protection off.
|
|
750
750
|
*/
|
|
751
|
-
widows?:
|
|
751
|
+
widows?: number;
|
|
752
752
|
/**
|
|
753
753
|
* The fewest lines of the code that may stand alone at the bottom of a page when it splits.
|
|
754
754
|
* Default 2. If fewer would fit, the whole code moves to the next page; 1 turns the protection
|
|
755
755
|
* off.
|
|
756
756
|
*/
|
|
757
|
-
orphans?:
|
|
757
|
+
orphans?: number;
|
|
758
758
|
}
|
|
759
759
|
/**
|
|
760
760
|
* Attributes of the `td` element.
|
|
@@ -791,7 +791,7 @@ export interface TdAttr {
|
|
|
791
791
|
* that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
|
|
792
792
|
* inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
|
|
793
793
|
*/
|
|
794
|
-
opacity?:
|
|
794
|
+
opacity?: number;
|
|
795
795
|
/**
|
|
796
796
|
* A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
|
|
797
797
|
* is left and up) and filled with the color, drawn under the box with the same radius. An opacity
|
|
@@ -811,7 +811,7 @@ export interface TdAttr {
|
|
|
811
811
|
* box inside another box they are not applied. no applies at any depth.
|
|
812
812
|
*/
|
|
813
813
|
paginate?: string;
|
|
814
|
-
debug?:
|
|
814
|
+
debug?: boolean;
|
|
815
815
|
/**
|
|
816
816
|
* How many of the table's columns the cell spans. It is as wide as those columns and the gaps
|
|
817
817
|
* between them, and the cells after it in the row start at the column after its last. A row whose
|
|
@@ -819,7 +819,7 @@ export interface TdAttr {
|
|
|
819
819
|
* last columns empty. It changes widths only: row heights and page breaks work as before. Default
|
|
820
820
|
* 1.
|
|
821
821
|
*/
|
|
822
|
-
colspan?:
|
|
822
|
+
colspan?: number;
|
|
823
823
|
/**
|
|
824
824
|
* How many rows the cell spans, its own included. It is as tall as those rows and the gaps
|
|
825
825
|
* between them, and the rows under it leave its columns out: their cells start at the first free
|
|
@@ -829,7 +829,7 @@ export interface TdAttr {
|
|
|
829
829
|
* spans stay on one page: the group moves to the next page whole when it does not fit, and one
|
|
830
830
|
* taller than a page is clipped at the page's end. Default 1.
|
|
831
831
|
*/
|
|
832
|
-
rowspan?:
|
|
832
|
+
rowspan?: number;
|
|
833
833
|
align?: string;
|
|
834
834
|
valign?: string;
|
|
835
835
|
}
|
|
@@ -895,7 +895,7 @@ export interface TableAttr {
|
|
|
895
895
|
width?: string;
|
|
896
896
|
height?: string;
|
|
897
897
|
paginate?: string;
|
|
898
|
-
debug?:
|
|
898
|
+
debug?: boolean;
|
|
899
899
|
}
|
|
900
900
|
/**
|
|
901
901
|
* Attributes of the `field` element.
|
|
@@ -907,10 +907,10 @@ export interface FieldAttr {
|
|
|
907
907
|
label?: string;
|
|
908
908
|
options?: string;
|
|
909
909
|
group?: string;
|
|
910
|
-
checked?:
|
|
911
|
-
required?:
|
|
912
|
-
readonly?:
|
|
913
|
-
maxLen?:
|
|
910
|
+
checked?: boolean;
|
|
911
|
+
required?: boolean;
|
|
912
|
+
readonly?: boolean;
|
|
913
|
+
maxLen?: number;
|
|
914
914
|
actionUrl?: string;
|
|
915
915
|
/**
|
|
916
916
|
* Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
|
|
@@ -921,7 +921,7 @@ export interface FieldAttr {
|
|
|
921
921
|
height?: string;
|
|
922
922
|
background?: string;
|
|
923
923
|
border?: string;
|
|
924
|
-
debug?:
|
|
924
|
+
debug?: boolean;
|
|
925
925
|
}
|
|
926
926
|
/**
|
|
927
927
|
* An entry of the PDF's outline, the bookmark panel of a viewer, and a target for links with
|
|
@@ -936,7 +936,7 @@ export interface BookmarkAttr {
|
|
|
936
936
|
* Depth in the outline, 1 to 6. Defaults to 1. An entry nests under the closest entry before it
|
|
937
937
|
* with a lower level.
|
|
938
938
|
*/
|
|
939
|
-
level?:
|
|
939
|
+
level?: number;
|
|
940
940
|
/**
|
|
941
941
|
* The name links use to jump here, as href="#id". Leave it out to make it from the label:
|
|
942
942
|
* lowercase, with other characters than letters and digits turned into hyphens, and -2, -3 added
|
|
@@ -962,7 +962,7 @@ export interface RegionAttr {
|
|
|
962
962
|
*/
|
|
963
963
|
page?: string;
|
|
964
964
|
w?: string;
|
|
965
|
-
debug?:
|
|
965
|
+
debug?: boolean;
|
|
966
966
|
}
|
|
967
967
|
/**
|
|
968
968
|
* Markdown as the content of a section, where a layout would go. It holds only Markdown: optional
|
|
@@ -1001,8 +1001,8 @@ export interface MarkdownAttr {
|
|
|
1001
1001
|
* How many levels of headings become bookmarks, for the outline of the viewer and the table of
|
|
1002
1002
|
* contents: n keeps the levels 1 to n, 0 none. Default 6.
|
|
1003
1003
|
*/
|
|
1004
|
-
bookmarks?:
|
|
1005
|
-
debug?:
|
|
1004
|
+
bookmarks?: number;
|
|
1005
|
+
debug?: boolean;
|
|
1006
1006
|
}
|
|
1007
1007
|
/**
|
|
1008
1008
|
* How the parts of the Markdown look. A rule is named after the Markdown it styles and takes the
|
|
@@ -1026,10 +1026,10 @@ export interface MarkdownStylesAttr {
|
|
|
1026
1026
|
export interface MarkdownH1Attr {
|
|
1027
1027
|
font?: string;
|
|
1028
1028
|
fontSize?: string;
|
|
1029
|
-
bold?:
|
|
1029
|
+
bold?: boolean;
|
|
1030
1030
|
color?: string;
|
|
1031
1031
|
align?: string;
|
|
1032
|
-
lineHeight?: string;
|
|
1032
|
+
lineHeight?: string | number;
|
|
1033
1033
|
padding?: string;
|
|
1034
1034
|
background?: string;
|
|
1035
1035
|
border?: string;
|
|
@@ -1041,10 +1041,10 @@ export interface MarkdownH1Attr {
|
|
|
1041
1041
|
export interface MarkdownH2Attr {
|
|
1042
1042
|
font?: string;
|
|
1043
1043
|
fontSize?: string;
|
|
1044
|
-
bold?:
|
|
1044
|
+
bold?: boolean;
|
|
1045
1045
|
color?: string;
|
|
1046
1046
|
align?: string;
|
|
1047
|
-
lineHeight?: string;
|
|
1047
|
+
lineHeight?: string | number;
|
|
1048
1048
|
padding?: string;
|
|
1049
1049
|
background?: string;
|
|
1050
1050
|
border?: string;
|
|
@@ -1056,10 +1056,10 @@ export interface MarkdownH2Attr {
|
|
|
1056
1056
|
export interface MarkdownH3Attr {
|
|
1057
1057
|
font?: string;
|
|
1058
1058
|
fontSize?: string;
|
|
1059
|
-
bold?:
|
|
1059
|
+
bold?: boolean;
|
|
1060
1060
|
color?: string;
|
|
1061
1061
|
align?: string;
|
|
1062
|
-
lineHeight?: string;
|
|
1062
|
+
lineHeight?: string | number;
|
|
1063
1063
|
padding?: string;
|
|
1064
1064
|
background?: string;
|
|
1065
1065
|
border?: string;
|
|
@@ -1071,10 +1071,10 @@ export interface MarkdownH3Attr {
|
|
|
1071
1071
|
export interface MarkdownH4Attr {
|
|
1072
1072
|
font?: string;
|
|
1073
1073
|
fontSize?: string;
|
|
1074
|
-
bold?:
|
|
1074
|
+
bold?: boolean;
|
|
1075
1075
|
color?: string;
|
|
1076
1076
|
align?: string;
|
|
1077
|
-
lineHeight?: string;
|
|
1077
|
+
lineHeight?: string | number;
|
|
1078
1078
|
padding?: string;
|
|
1079
1079
|
background?: string;
|
|
1080
1080
|
border?: string;
|
|
@@ -1086,10 +1086,10 @@ export interface MarkdownH4Attr {
|
|
|
1086
1086
|
export interface MarkdownH5Attr {
|
|
1087
1087
|
font?: string;
|
|
1088
1088
|
fontSize?: string;
|
|
1089
|
-
bold?:
|
|
1089
|
+
bold?: boolean;
|
|
1090
1090
|
color?: string;
|
|
1091
1091
|
align?: string;
|
|
1092
|
-
lineHeight?: string;
|
|
1092
|
+
lineHeight?: string | number;
|
|
1093
1093
|
padding?: string;
|
|
1094
1094
|
background?: string;
|
|
1095
1095
|
border?: string;
|
|
@@ -1101,10 +1101,10 @@ export interface MarkdownH5Attr {
|
|
|
1101
1101
|
export interface MarkdownH6Attr {
|
|
1102
1102
|
font?: string;
|
|
1103
1103
|
fontSize?: string;
|
|
1104
|
-
bold?:
|
|
1104
|
+
bold?: boolean;
|
|
1105
1105
|
color?: string;
|
|
1106
1106
|
align?: string;
|
|
1107
|
-
lineHeight?: string;
|
|
1107
|
+
lineHeight?: string | number;
|
|
1108
1108
|
padding?: string;
|
|
1109
1109
|
background?: string;
|
|
1110
1110
|
border?: string;
|
|
@@ -1116,10 +1116,10 @@ export interface MarkdownH6Attr {
|
|
|
1116
1116
|
export interface MarkdownPAttr {
|
|
1117
1117
|
font?: string;
|
|
1118
1118
|
fontSize?: string;
|
|
1119
|
-
bold?:
|
|
1119
|
+
bold?: boolean;
|
|
1120
1120
|
color?: string;
|
|
1121
1121
|
align?: string;
|
|
1122
|
-
lineHeight?: string;
|
|
1122
|
+
lineHeight?: string | number;
|
|
1123
1123
|
padding?: string;
|
|
1124
1124
|
background?: string;
|
|
1125
1125
|
border?: string;
|
|
@@ -1134,12 +1134,12 @@ export interface MarkdownCodeAttr {
|
|
|
1134
1134
|
font?: string;
|
|
1135
1135
|
fontSize?: string;
|
|
1136
1136
|
color?: string;
|
|
1137
|
-
lineHeight?: string;
|
|
1137
|
+
lineHeight?: string | number;
|
|
1138
1138
|
padding?: string;
|
|
1139
1139
|
background?: string;
|
|
1140
1140
|
border?: string;
|
|
1141
1141
|
radius?: string;
|
|
1142
|
-
tabSize?:
|
|
1142
|
+
tabSize?: number;
|
|
1143
1143
|
}
|
|
1144
1144
|
/**
|
|
1145
1145
|
* A block quote, written > in Markdown: a bar beside its content. font, font-size, color,
|
|
@@ -1150,10 +1150,10 @@ export interface MarkdownCodeAttr {
|
|
|
1150
1150
|
export interface MarkdownQuoteAttr {
|
|
1151
1151
|
font?: string;
|
|
1152
1152
|
fontSize?: string;
|
|
1153
|
-
bold?:
|
|
1153
|
+
bold?: boolean;
|
|
1154
1154
|
color?: string;
|
|
1155
1155
|
align?: string;
|
|
1156
|
-
lineHeight?: string;
|
|
1156
|
+
lineHeight?: string | number;
|
|
1157
1157
|
padding?: string;
|
|
1158
1158
|
background?: string;
|
|
1159
1159
|
border?: string;
|
|
@@ -1182,8 +1182,8 @@ export interface MarkdownLiAttr {
|
|
|
1182
1182
|
export interface MarkdownAAttr {
|
|
1183
1183
|
font?: string;
|
|
1184
1184
|
color?: string;
|
|
1185
|
-
bold?:
|
|
1186
|
-
underline?:
|
|
1185
|
+
bold?: boolean;
|
|
1186
|
+
underline?: boolean;
|
|
1187
1187
|
}
|
|
1188
1188
|
/**
|
|
1189
1189
|
* Strong text, written **text** in Markdown. Bold in a built-in font; an embedded font names its
|
|
@@ -1192,7 +1192,7 @@ export interface MarkdownAAttr {
|
|
|
1192
1192
|
export interface MarkdownStrongAttr {
|
|
1193
1193
|
font?: string;
|
|
1194
1194
|
color?: string;
|
|
1195
|
-
bold?:
|
|
1195
|
+
bold?: boolean;
|
|
1196
1196
|
}
|
|
1197
1197
|
/**
|
|
1198
1198
|
* Emphasis, written *text* in Markdown. Italic in a built-in font; an embedded font names its
|
|
@@ -1208,7 +1208,7 @@ export interface MarkdownEmAttr {
|
|
|
1208
1208
|
export interface MarkdownDelAttr {
|
|
1209
1209
|
font?: string;
|
|
1210
1210
|
color?: string;
|
|
1211
|
-
strike?:
|
|
1211
|
+
strike?: boolean;
|
|
1212
1212
|
}
|
|
1213
1213
|
/**
|
|
1214
1214
|
* A table. Its columns are sized by their content: a column takes the width its cells need on one
|
|
@@ -1233,7 +1233,7 @@ export interface MarkdownTableAttr {
|
|
|
1233
1233
|
export interface MarkdownThAttr {
|
|
1234
1234
|
font?: string;
|
|
1235
1235
|
fontSize?: string;
|
|
1236
|
-
bold?:
|
|
1236
|
+
bold?: boolean;
|
|
1237
1237
|
color?: string;
|
|
1238
1238
|
align?: string;
|
|
1239
1239
|
padding?: string;
|
|
@@ -1246,7 +1246,7 @@ export interface MarkdownThAttr {
|
|
|
1246
1246
|
export interface MarkdownTdAttr {
|
|
1247
1247
|
font?: string;
|
|
1248
1248
|
fontSize?: string;
|
|
1249
|
-
bold?:
|
|
1249
|
+
bold?: boolean;
|
|
1250
1250
|
color?: string;
|
|
1251
1251
|
align?: string;
|
|
1252
1252
|
padding?: string;
|
|
@@ -1267,7 +1267,7 @@ export interface LayerAttr {
|
|
|
1267
1267
|
* How opaque everything in the layer is, from 0 to 1. To fade one element, put it in a layer of
|
|
1268
1268
|
* its own.
|
|
1269
1269
|
*/
|
|
1270
|
-
opacity?:
|
|
1270
|
+
opacity?: number;
|
|
1271
1271
|
transform?: string;
|
|
1272
1272
|
/**
|
|
1273
1273
|
* A rectangle that cuts off what the layer draws outside it: x y w h, in points from the top left
|
|
@@ -1415,28 +1415,28 @@ export interface TextAtAttr {
|
|
|
1415
1415
|
* Helvetica-Bold, Times-Roman becomes Times-Bold, Courier becomes Courier-Bold, and the oblique
|
|
1416
1416
|
* and italic faces their bold forms. A custom font has no bold face to pick, so name one in font.
|
|
1417
1417
|
*/
|
|
1418
|
-
bold?:
|
|
1418
|
+
bold?: boolean;
|
|
1419
1419
|
color?: string;
|
|
1420
1420
|
align?: string;
|
|
1421
1421
|
/**
|
|
1422
1422
|
* The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
|
|
1423
1423
|
* name from the line-height row of the tokens. Default 1.2, which is the token m.
|
|
1424
1424
|
*/
|
|
1425
|
-
lineHeight?: string;
|
|
1425
|
+
lineHeight?: string | number;
|
|
1426
1426
|
/**
|
|
1427
1427
|
* The most lines drawn. Only whole lines are drawn, and the rest of the text is dropped. A text
|
|
1428
1428
|
* in the layout has no cap by default and wraps at the width it has; the lines it drops take no
|
|
1429
1429
|
* room, and a text that splits across pages keeps the cap across them. A text-at is one line by
|
|
1430
1430
|
* default, and above 1 needs a width to wrap within.
|
|
1431
1431
|
*/
|
|
1432
|
-
maxLines?:
|
|
1432
|
+
maxLines?: number;
|
|
1433
1433
|
/**
|
|
1434
1434
|
* End the last line drawn in an ellipsis when max-lines drops text, shortened to fit the width.
|
|
1435
1435
|
* Off by default: the text stops at the end of a line. A text-at also ends a line in one when it
|
|
1436
1436
|
* is cut off at its width. A text in the layout without max-lines is never cut, so there it has
|
|
1437
1437
|
* no effect.
|
|
1438
1438
|
*/
|
|
1439
|
-
ellipsis?:
|
|
1439
|
+
ellipsis?: boolean;
|
|
1440
1440
|
/**
|
|
1441
1441
|
* Width of the box. Without it the text is one line of the width its characters need, and align
|
|
1442
1442
|
* has no effect; a long text runs on past the edge of the page, which cuts it off, but stays in
|
|
@@ -1481,7 +1481,7 @@ export interface BarcodeAtAttr {
|
|
|
1481
1481
|
*/
|
|
1482
1482
|
height?: string;
|
|
1483
1483
|
ec?: string;
|
|
1484
|
-
hrt?:
|
|
1484
|
+
hrt?: boolean;
|
|
1485
1485
|
color?: string;
|
|
1486
1486
|
background?: string;
|
|
1487
1487
|
x?: string;
|
|
@@ -1538,3 +1538,78 @@ export interface ImageAttr {
|
|
|
1538
1538
|
*/
|
|
1539
1539
|
src?: string;
|
|
1540
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
|
+
}
|