@lpdfio/lpdf 0.30.0 → 0.32.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/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?: string;
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,20 @@ 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?: string;
57
+ debug?: boolean;
58
+ /**
59
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
60
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
61
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
62
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
63
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
64
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
65
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
66
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
67
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
68
+ * on in a layers panel.
69
+ */
70
+ ocg?: string;
58
71
  align?: string;
59
72
  justify?: string;
60
73
  /**
@@ -102,7 +115,7 @@ export interface RowAttr {
102
115
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
103
116
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
104
117
  */
105
- opacity?: string;
118
+ opacity?: number;
106
119
  /**
107
120
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
108
121
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -122,7 +135,20 @@ export interface RowAttr {
122
135
  * box inside another box they are not applied. no applies at any depth.
123
136
  */
124
137
  paginate?: string;
125
- debug?: string;
138
+ debug?: boolean;
139
+ /**
140
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
141
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
142
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
143
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
144
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
145
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
146
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
147
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
148
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
149
+ * on in a layers panel.
150
+ */
151
+ ocg?: string;
126
152
  align?: string;
127
153
  justify?: string;
128
154
  /**
@@ -168,7 +194,7 @@ export interface GridAttr {
168
194
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
169
195
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
170
196
  */
171
- opacity?: string;
197
+ opacity?: number;
172
198
  /**
173
199
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
174
200
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -188,7 +214,20 @@ export interface GridAttr {
188
214
  * box inside another box they are not applied. no applies at any depth.
189
215
  */
190
216
  paginate?: string;
191
- debug?: string;
217
+ debug?: boolean;
218
+ /**
219
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
220
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
221
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
222
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
223
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
224
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
225
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
226
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
227
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
228
+ * on in a layers panel.
229
+ */
230
+ ocg?: string;
192
231
  /**
193
232
  * Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
194
233
  * the other children, shared equally if several on the line use fill, and never moves to the next
@@ -196,7 +235,7 @@ export interface GridAttr {
196
235
  */
197
236
  width?: string;
198
237
  colWidth?: string;
199
- cols?: string;
238
+ cols?: number;
200
239
  }
201
240
  /**
202
241
  * A list of items, each with a marker: a bullet drawn as a shape, or a number the engine gives. The
@@ -236,7 +275,7 @@ export interface ListAttr {
236
275
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
237
276
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
238
277
  */
239
- opacity?: string;
278
+ opacity?: number;
240
279
  /**
241
280
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
242
281
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -256,7 +295,20 @@ export interface ListAttr {
256
295
  * box inside another box they are not applied. no applies at any depth.
257
296
  */
258
297
  paginate?: string;
259
- debug?: string;
298
+ debug?: boolean;
299
+ /**
300
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
301
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
302
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
303
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
304
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
305
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
306
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
307
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
308
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
309
+ * on in a layers panel.
310
+ */
311
+ ocg?: string;
260
312
  /** bullet marks each item with a shape, number with a number. Default bullet. */
261
313
  type?: string;
262
314
  /**
@@ -270,7 +322,7 @@ export interface ListAttr {
270
322
  * The number of a number list's first item, to continue a list that something cut in two. Default
271
323
  * 1.
272
324
  */
273
- start?: string;
325
+ start?: number;
274
326
  /**
275
327
  * Text before each number of a number list: prefix="(" and suffix=")" write (a). Default none.
276
328
  */
@@ -338,7 +390,7 @@ export interface LiAttr {
338
390
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
339
391
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
340
392
  */
341
- opacity?: string;
393
+ opacity?: number;
342
394
  /**
343
395
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
344
396
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -358,7 +410,20 @@ export interface LiAttr {
358
410
  * box inside another box they are not applied. no applies at any depth.
359
411
  */
360
412
  paginate?: string;
361
- debug?: string;
413
+ debug?: boolean;
414
+ /**
415
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
416
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
417
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
418
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
419
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
420
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
421
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
422
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
423
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
424
+ * on in a layers panel.
425
+ */
426
+ ocg?: string;
362
427
  /**
363
428
  * Makes the item's marker a checkbox in place of the bullet or the number: an outline in the line
364
429
  * color, with a tick in the color of the item's words when this is true, and empty when it is
@@ -366,7 +431,7 @@ export interface LiAttr {
366
431
  * number. An item without it keeps its bullet or number. A task item of a Markdown, - [ ] or -
367
432
  * [x], is one.
368
433
  */
369
- checked?: string;
434
+ checked?: boolean;
370
435
  }
371
436
  /**
372
437
  * A box around a single child, which it centres. Never splits across pages: if it does not fit, the
@@ -403,7 +468,7 @@ export interface FrameAttr {
403
468
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
404
469
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
405
470
  */
406
- opacity?: string;
471
+ opacity?: number;
407
472
  /**
408
473
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
409
474
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -423,7 +488,20 @@ export interface FrameAttr {
423
488
  * box inside another box they are not applied. no applies at any depth.
424
489
  */
425
490
  paginate?: string;
426
- debug?: string;
491
+ debug?: boolean;
492
+ /**
493
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
494
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
495
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
496
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
497
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
498
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
499
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
500
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
501
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
502
+ * on in a layers panel.
503
+ */
504
+ ocg?: string;
427
505
  /**
428
506
  * Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
429
507
  * the other children, shared equally if several on the line use fill, and never moves to the next
@@ -448,7 +526,20 @@ export interface LinkAttr {
448
526
  */
449
527
  width?: string;
450
528
  height?: string;
451
- debug?: string;
529
+ debug?: boolean;
530
+ /**
531
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
532
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
533
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
534
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
535
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
536
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
537
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
538
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
539
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
540
+ * on in a layers panel.
541
+ */
542
+ ocg?: string;
452
543
  }
453
544
  /**
454
545
  * Attributes of the `divider` element.
@@ -463,22 +554,46 @@ export interface DividerAttr {
463
554
  * line; in a column it takes the full width.
464
555
  */
465
556
  width?: string;
466
- debug?: string;
557
+ debug?: boolean;
558
+ /**
559
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
560
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
561
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
562
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
563
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
564
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
565
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
566
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
567
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
568
+ * on in a layers panel.
569
+ */
570
+ ocg?: string;
467
571
  }
468
572
  /**
469
573
  * Attributes of the `span` element.
470
574
  */
471
575
  export interface SpanAttr {
472
576
  font?: string;
473
- bold?: string;
577
+ bold?: boolean;
474
578
  color?: string;
475
579
  /**
476
580
  * Makes the span a link: a URL, or #id to jump to the bookmark with that id. In an entry of a
477
581
  * table of contents, # alone jumps to that entry's bookmark.
478
582
  */
479
583
  href?: string;
480
- underline?: string;
481
- strike?: string;
584
+ /**
585
+ * Makes the span a cross-reference to the bookmark with this id: a link to it whose words say
586
+ * where it is. In the span's words, {bookmark-page} prints the page the bookmark is on, as the
587
+ * footer of that page prints it, and {bookmark-label} the bookmark's label, so "{bookmark-label},
588
+ * on page {bookmark-page}" shows "clause 4, on page 12". An id that no bookmark has, another {…}
589
+ * token in the words, and href beside it are errors. It works in a text, a footnote, a region, a
590
+ * text-at and a code. The document is laid out again until each reference shows the page its
591
+ * bookmark lands on, and a reference keeps room for the widest words it has shown, so a number
592
+ * that got narrower can leave a small gap after it.
593
+ */
594
+ bookmarkRef?: string;
595
+ underline?: boolean;
596
+ strike?: boolean;
482
597
  }
483
598
  /**
484
599
  * A run of code inside a text: its words in Courier on a light tint, the tint drawn behind them. It
@@ -501,6 +616,12 @@ export interface CodeSpanAttr {
501
616
  */
502
617
  export interface ImgAttr {
503
618
  name: string;
619
+ /**
620
+ * What the image shows, which a screen reader reads in a PDF/UA document; alt="" marks it as
621
+ * decoration, which a reader skips. A PDF/UA document needs it on every image of the layout. A
622
+ * document without pdfua ignores it.
623
+ */
624
+ alt?: string;
504
625
  height?: string;
505
626
  /**
506
627
  * Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
@@ -516,7 +637,20 @@ export interface ImgAttr {
516
637
  border?: string;
517
638
  radius?: string;
518
639
  paginate?: string;
519
- debug?: string;
640
+ debug?: boolean;
641
+ /**
642
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
643
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
644
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
645
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
646
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
647
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
648
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
649
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
650
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
651
+ * on in a layers panel.
652
+ */
653
+ ocg?: string;
520
654
  }
521
655
  /**
522
656
  * A rectangle, a circle or an ellipse in the layout, for a status dot, a color swatch or a progress
@@ -547,8 +681,21 @@ export interface ShapeAttr {
547
681
  strokeWidth?: string;
548
682
  strokeDash?: string;
549
683
  /** How opaque the shape is, from 0 to 1. Default 1. */
550
- opacity?: string;
551
- debug?: string;
684
+ opacity?: number;
685
+ debug?: boolean;
686
+ /**
687
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
688
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
689
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
690
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
691
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
692
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
693
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
694
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
695
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
696
+ * on in a layers panel.
697
+ */
698
+ ocg?: string;
552
699
  }
553
700
  /**
554
701
  * A QR code, a Code 128 or an EAN-13. It is never stretched. With only a width or a height, the
@@ -571,7 +718,7 @@ export interface BarcodeAttr {
571
718
  */
572
719
  height?: string;
573
720
  ec?: string;
574
- hrt?: string;
721
+ hrt?: boolean;
575
722
  color?: string;
576
723
  background?: string;
577
724
  /**
@@ -580,8 +727,27 @@ export interface BarcodeAttr {
580
727
  * line; in a column it takes the full width.
581
728
  */
582
729
  width?: string;
730
+ /**
731
+ * What the barcode is for, which a screen reader reads in a PDF/UA document in place of its data,
732
+ * which means nothing read aloud: "QR code to pay this invoice". alt="" marks it as decoration. A
733
+ * PDF/UA document needs it on every barcode of the layout. A document without pdfua ignores it.
734
+ */
735
+ alt?: string;
583
736
  paginate?: string;
584
- debug?: string;
737
+ debug?: boolean;
738
+ /**
739
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
740
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
741
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
742
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
743
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
744
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
745
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
746
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
747
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
748
+ * on in a layers panel.
749
+ */
750
+ ocg?: string;
585
751
  }
586
752
  /**
587
753
  * A block of wrapping text. Use span children to style parts of it, and fn children for footnotes.
@@ -595,47 +761,54 @@ export interface TextAttr {
595
761
  * Helvetica-Bold, Times-Roman becomes Times-Bold, Courier becomes Courier-Bold, and the oblique
596
762
  * and italic faces their bold forms. A custom font has no bold face to pick, so name one in font.
597
763
  */
598
- bold?: string;
764
+ bold?: boolean;
599
765
  color?: string;
600
766
  align?: string;
601
767
  /**
602
768
  * The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
603
769
  * name from the line-height row of the tokens. Default 1.2, which is the token m.
604
770
  */
605
- lineHeight?: string;
771
+ lineHeight?: string | number;
606
772
  /**
607
773
  * The most lines drawn. Only whole lines are drawn, and the rest of the text is dropped. A text
608
774
  * in the layout has no cap by default and wraps at the width it has; the lines it drops take no
609
775
  * room, and a text that splits across pages keeps the cap across them. A text-at is one line by
610
776
  * default, and above 1 needs a width to wrap within.
611
777
  */
612
- maxLines?: string;
778
+ maxLines?: number;
613
779
  /**
614
780
  * End the last line drawn in an ellipsis when max-lines drops text, shortened to fit the width.
615
781
  * Off by default: the text stops at the end of a line. A text-at also ends a line in one when it
616
782
  * is cut off at its width. A text in the layout without max-lines is never cut, so there it has
617
783
  * no effect.
618
784
  */
619
- ellipsis?: string;
785
+ ellipsis?: boolean;
620
786
  /**
621
787
  * Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
622
788
  * the other children, shared equally if several on the line use fill, and never moves to the next
623
789
  * line; in a column it takes the full width.
624
790
  */
625
791
  width?: string;
792
+ /**
793
+ * Makes the text a heading, h1 to h6, which a PDF/UA document tags as one: a screen reader lists
794
+ * the headings and moves between them. A text without role is a paragraph. A PDF/UA document's
795
+ * headings start at h1 and go down one level at a time. It changes nothing a page shows: set the
796
+ * size and the weight as on any text. A document without pdfua ignores it.
797
+ */
798
+ role?: string;
626
799
  /**
627
800
  * The fewest lines of the text that may stand alone at the top of the next page when it splits.
628
801
  * Default 2. If fewer would be left, lines move from the first page to the next; 1 turns the
629
802
  * protection off.
630
803
  */
631
- widows?: string;
804
+ widows?: number;
632
805
  /**
633
806
  * The fewest lines of the text that may stand alone at the bottom of a page when it splits.
634
807
  * Default 2. If fewer would fit, the whole text moves to the next page; 1 turns the protection
635
808
  * off. When no split can keep both widows and orphans, even on an empty page, the text splits
636
809
  * where the lines fit.
637
810
  */
638
- orphans?: string;
811
+ orphans?: number;
639
812
  /**
640
813
  * Records the words of this text under a name as the pages are filled, so a text with capture-ref
641
814
  * in a header or a footer can show them. Put it on a heading in the flow. The page that holds the
@@ -662,7 +835,20 @@ export interface TextAttr {
662
835
  */
663
836
  captureFallback?: string;
664
837
  paginate?: string;
665
- debug?: string;
838
+ debug?: boolean;
839
+ /**
840
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
841
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
842
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
843
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
844
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
845
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
846
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
847
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
848
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
849
+ * on in a layers panel.
850
+ */
851
+ ocg?: string;
666
852
  }
667
853
  /**
668
854
  * Code, or any text whose spaces and lines matter, in a box. The text is kept as it is written:
@@ -706,7 +892,7 @@ export interface CodeAttr {
706
892
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
707
893
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
708
894
  */
709
- opacity?: string;
895
+ opacity?: number;
710
896
  /**
711
897
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
712
898
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -726,7 +912,20 @@ export interface CodeAttr {
726
912
  * box inside another box they are not applied. no applies at any depth.
727
913
  */
728
914
  paginate?: string;
729
- debug?: string;
915
+ debug?: boolean;
916
+ /**
917
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
918
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
919
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
920
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
921
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
922
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
923
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
924
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
925
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
926
+ * on in a layers panel.
927
+ */
928
+ ocg?: string;
730
929
  /**
731
930
  * Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
732
931
  * the other children, shared equally if several on the line use fill, and never moves to the next
@@ -737,24 +936,24 @@ export interface CodeAttr {
737
936
  * How many columns a tab fills to: it moves the next character to the next multiple of this many
738
937
  * characters from the start of the line. Default 4.
739
938
  */
740
- tabSize?: string;
939
+ tabSize?: number;
741
940
  /**
742
941
  * The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
743
942
  * name from the line-height row of the tokens. Default 1.2, which is the token m.
744
943
  */
745
- lineHeight?: string;
944
+ lineHeight?: string | number;
746
945
  /**
747
946
  * The fewest lines of the code that may stand alone at the top of the next page when it splits.
748
947
  * Default 2. If fewer would be left, lines move from the first page to the next; 1 turns the
749
948
  * protection off.
750
949
  */
751
- widows?: string;
950
+ widows?: number;
752
951
  /**
753
952
  * The fewest lines of the code that may stand alone at the bottom of a page when it splits.
754
953
  * Default 2. If fewer would fit, the whole code moves to the next page; 1 turns the protection
755
954
  * off.
756
955
  */
757
- orphans?: string;
956
+ orphans?: number;
758
957
  }
759
958
  /**
760
959
  * Attributes of the `td` element.
@@ -791,7 +990,7 @@ export interface TdAttr {
791
990
  * that overlap do not show through each other, and a box inside a faded box is faded further: 0.5
792
991
  * inside 0.5 is drawn at 0.25. A form field in the box is not faded. Default 1.
793
992
  */
794
- opacity?: string;
993
+ opacity?: number;
795
994
  /**
796
995
  * A hard-edged shadow: a copy of the box, moved right and down by the first two lengths (negative
797
996
  * is left and up) and filled with the color, drawn under the box with the same radius. An opacity
@@ -811,7 +1010,20 @@ export interface TdAttr {
811
1010
  * box inside another box they are not applied. no applies at any depth.
812
1011
  */
813
1012
  paginate?: string;
814
- debug?: string;
1013
+ debug?: boolean;
1014
+ /**
1015
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1016
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1017
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1018
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1019
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1020
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1021
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1022
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1023
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1024
+ * on in a layers panel.
1025
+ */
1026
+ ocg?: string;
815
1027
  /**
816
1028
  * How many of the table's columns the cell spans. It is as wide as those columns and the gaps
817
1029
  * between them, and the cells after it in the row start at the column after its last. A row whose
@@ -819,7 +1031,7 @@ export interface TdAttr {
819
1031
  * last columns empty. It changes widths only: row heights and page breaks work as before. Default
820
1032
  * 1.
821
1033
  */
822
- colspan?: string;
1034
+ colspan?: number;
823
1035
  /**
824
1036
  * How many rows the cell spans, its own included. It is as tall as those rows and the gaps
825
1037
  * between them, and the rows under it leave its columns out: their cells start at the first free
@@ -829,7 +1041,7 @@ export interface TdAttr {
829
1041
  * spans stay on one page: the group moves to the next page whole when it does not fit, and one
830
1042
  * taller than a page is clipped at the page's end. Default 1.
831
1043
  */
832
- rowspan?: string;
1044
+ rowspan?: number;
833
1045
  align?: string;
834
1046
  valign?: string;
835
1047
  }
@@ -838,6 +1050,19 @@ export interface TdAttr {
838
1050
  */
839
1051
  export interface TheadAttr {
840
1052
  background?: string;
1053
+ /**
1054
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1055
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1056
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1057
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1058
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1059
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1060
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1061
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1062
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1063
+ * on in a layers panel.
1064
+ */
1065
+ ocg?: string;
841
1066
  }
842
1067
  /**
843
1068
  * Attributes of the `tr` element.
@@ -852,6 +1077,19 @@ export interface TrAttr {
852
1077
  */
853
1078
  keep?: string;
854
1079
  background?: string;
1080
+ /**
1081
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1082
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1083
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1084
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1085
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1086
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1087
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1088
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1089
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1090
+ * on in a layers panel.
1091
+ */
1092
+ ocg?: string;
855
1093
  }
856
1094
  /**
857
1095
  * Rows and cells in columns whose widths are set by cols. The thead row repeats at the top of every
@@ -895,7 +1133,20 @@ export interface TableAttr {
895
1133
  width?: string;
896
1134
  height?: string;
897
1135
  paginate?: string;
898
- debug?: string;
1136
+ debug?: boolean;
1137
+ /**
1138
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1139
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1140
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1141
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1142
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1143
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1144
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1145
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1146
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1147
+ * on in a layers panel.
1148
+ */
1149
+ ocg?: string;
899
1150
  }
900
1151
  /**
901
1152
  * Attributes of the `field` element.
@@ -907,10 +1158,10 @@ export interface FieldAttr {
907
1158
  label?: string;
908
1159
  options?: string;
909
1160
  group?: string;
910
- checked?: string;
911
- required?: string;
912
- readonly?: string;
913
- maxLen?: string;
1161
+ checked?: boolean;
1162
+ required?: boolean;
1163
+ readonly?: boolean;
1164
+ maxLen?: number;
914
1165
  actionUrl?: string;
915
1166
  /**
916
1167
  * Width of the element. A length fixes it. fill, in a row, takes the width its line leaves after
@@ -921,13 +1172,26 @@ export interface FieldAttr {
921
1172
  height?: string;
922
1173
  background?: string;
923
1174
  border?: string;
924
- debug?: string;
1175
+ debug?: boolean;
1176
+ /**
1177
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1178
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1179
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1180
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1181
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1182
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1183
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1184
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1185
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1186
+ * on in a layers panel.
1187
+ */
1188
+ ocg?: string;
925
1189
  }
926
1190
  /**
927
1191
  * An entry of the PDF's outline, the bookmark panel of a viewer, and a target for links with
928
- * href="#id". It draws nothing and marks the element that follows it, so it is never left at the
929
- * bottom of a page apart from that element. Directly inside a section, it marks the section's first
930
- * page.
1192
+ * href="#id" and for cross-references with bookmark-ref. It draws nothing and marks the element
1193
+ * that follows it, so it is never left at the bottom of a page apart from that element. Directly
1194
+ * inside a section, it marks the section's first page.
931
1195
  */
932
1196
  export interface BookmarkAttr {
933
1197
  /** The text of the entry, in the outline and in a table of contents. */
@@ -936,13 +1200,21 @@ export interface BookmarkAttr {
936
1200
  * Depth in the outline, 1 to 6. Defaults to 1. An entry nests under the closest entry before it
937
1201
  * with a lower level.
938
1202
  */
939
- level?: string;
1203
+ level?: number;
940
1204
  /**
941
- * The name links use to jump here, as href="#id". Leave it out to make it from the label:
942
- * lowercase, with other characters than letters and digits turned into hyphens, and -2, -3 added
943
- * when an earlier bookmark has it. Two bookmarks may not have the same id.
1205
+ * The name links use to jump here, as href="#id", and cross-references as bookmark-ref="id".
1206
+ * Leave it out to make it from the label: lowercase, with other characters than letters and
1207
+ * digits turned into hyphens, and -2, -3 added when an earlier bookmark has it. Two bookmarks may
1208
+ * not have the same id.
944
1209
  */
945
1210
  id?: string;
1211
+ /**
1212
+ * true leaves the bookmark out of the viewer's outline and out of the table of contents, for a
1213
+ * figure or a table: label="Table 3" ref-only="true". Links with href="#id" and cross-references
1214
+ * with bookmark-ref still reach it, and {bookmark-label} still shows its label. Defaults to
1215
+ * false.
1216
+ */
1217
+ refOnly?: boolean;
946
1218
  }
947
1219
  /**
948
1220
  * Pins content to the top or bottom edge of pages, outside the normal flow, for headers and
@@ -962,7 +1234,7 @@ export interface RegionAttr {
962
1234
  */
963
1235
  page?: string;
964
1236
  w?: string;
965
- debug?: string;
1237
+ debug?: boolean;
966
1238
  }
967
1239
  /**
968
1240
  * Markdown as the content of a section, where a layout would go. It holds only Markdown: optional
@@ -1001,8 +1273,8 @@ export interface MarkdownAttr {
1001
1273
  * How many levels of headings become bookmarks, for the outline of the viewer and the table of
1002
1274
  * contents: n keeps the levels 1 to n, 0 none. Default 6.
1003
1275
  */
1004
- bookmarks?: string;
1005
- debug?: string;
1276
+ bookmarks?: number;
1277
+ debug?: boolean;
1006
1278
  }
1007
1279
  /**
1008
1280
  * How the parts of the Markdown look. A rule is named after the Markdown it styles and takes the
@@ -1026,10 +1298,10 @@ export interface MarkdownStylesAttr {
1026
1298
  export interface MarkdownH1Attr {
1027
1299
  font?: string;
1028
1300
  fontSize?: string;
1029
- bold?: string;
1301
+ bold?: boolean;
1030
1302
  color?: string;
1031
1303
  align?: string;
1032
- lineHeight?: string;
1304
+ lineHeight?: string | number;
1033
1305
  padding?: string;
1034
1306
  background?: string;
1035
1307
  border?: string;
@@ -1041,10 +1313,10 @@ export interface MarkdownH1Attr {
1041
1313
  export interface MarkdownH2Attr {
1042
1314
  font?: string;
1043
1315
  fontSize?: string;
1044
- bold?: string;
1316
+ bold?: boolean;
1045
1317
  color?: string;
1046
1318
  align?: string;
1047
- lineHeight?: string;
1319
+ lineHeight?: string | number;
1048
1320
  padding?: string;
1049
1321
  background?: string;
1050
1322
  border?: string;
@@ -1056,10 +1328,10 @@ export interface MarkdownH2Attr {
1056
1328
  export interface MarkdownH3Attr {
1057
1329
  font?: string;
1058
1330
  fontSize?: string;
1059
- bold?: string;
1331
+ bold?: boolean;
1060
1332
  color?: string;
1061
1333
  align?: string;
1062
- lineHeight?: string;
1334
+ lineHeight?: string | number;
1063
1335
  padding?: string;
1064
1336
  background?: string;
1065
1337
  border?: string;
@@ -1071,10 +1343,10 @@ export interface MarkdownH3Attr {
1071
1343
  export interface MarkdownH4Attr {
1072
1344
  font?: string;
1073
1345
  fontSize?: string;
1074
- bold?: string;
1346
+ bold?: boolean;
1075
1347
  color?: string;
1076
1348
  align?: string;
1077
- lineHeight?: string;
1349
+ lineHeight?: string | number;
1078
1350
  padding?: string;
1079
1351
  background?: string;
1080
1352
  border?: string;
@@ -1086,10 +1358,10 @@ export interface MarkdownH4Attr {
1086
1358
  export interface MarkdownH5Attr {
1087
1359
  font?: string;
1088
1360
  fontSize?: string;
1089
- bold?: string;
1361
+ bold?: boolean;
1090
1362
  color?: string;
1091
1363
  align?: string;
1092
- lineHeight?: string;
1364
+ lineHeight?: string | number;
1093
1365
  padding?: string;
1094
1366
  background?: string;
1095
1367
  border?: string;
@@ -1101,10 +1373,10 @@ export interface MarkdownH5Attr {
1101
1373
  export interface MarkdownH6Attr {
1102
1374
  font?: string;
1103
1375
  fontSize?: string;
1104
- bold?: string;
1376
+ bold?: boolean;
1105
1377
  color?: string;
1106
1378
  align?: string;
1107
- lineHeight?: string;
1379
+ lineHeight?: string | number;
1108
1380
  padding?: string;
1109
1381
  background?: string;
1110
1382
  border?: string;
@@ -1116,10 +1388,10 @@ export interface MarkdownH6Attr {
1116
1388
  export interface MarkdownPAttr {
1117
1389
  font?: string;
1118
1390
  fontSize?: string;
1119
- bold?: string;
1391
+ bold?: boolean;
1120
1392
  color?: string;
1121
1393
  align?: string;
1122
- lineHeight?: string;
1394
+ lineHeight?: string | number;
1123
1395
  padding?: string;
1124
1396
  background?: string;
1125
1397
  border?: string;
@@ -1134,12 +1406,12 @@ export interface MarkdownCodeAttr {
1134
1406
  font?: string;
1135
1407
  fontSize?: string;
1136
1408
  color?: string;
1137
- lineHeight?: string;
1409
+ lineHeight?: string | number;
1138
1410
  padding?: string;
1139
1411
  background?: string;
1140
1412
  border?: string;
1141
1413
  radius?: string;
1142
- tabSize?: string;
1414
+ tabSize?: number;
1143
1415
  }
1144
1416
  /**
1145
1417
  * A block quote, written > in Markdown: a bar beside its content. font, font-size, color,
@@ -1150,10 +1422,10 @@ export interface MarkdownCodeAttr {
1150
1422
  export interface MarkdownQuoteAttr {
1151
1423
  font?: string;
1152
1424
  fontSize?: string;
1153
- bold?: string;
1425
+ bold?: boolean;
1154
1426
  color?: string;
1155
1427
  align?: string;
1156
- lineHeight?: string;
1428
+ lineHeight?: string | number;
1157
1429
  padding?: string;
1158
1430
  background?: string;
1159
1431
  border?: string;
@@ -1182,8 +1454,8 @@ export interface MarkdownLiAttr {
1182
1454
  export interface MarkdownAAttr {
1183
1455
  font?: string;
1184
1456
  color?: string;
1185
- bold?: string;
1186
- underline?: string;
1457
+ bold?: boolean;
1458
+ underline?: boolean;
1187
1459
  }
1188
1460
  /**
1189
1461
  * Strong text, written **text** in Markdown. Bold in a built-in font; an embedded font names its
@@ -1192,7 +1464,7 @@ export interface MarkdownAAttr {
1192
1464
  export interface MarkdownStrongAttr {
1193
1465
  font?: string;
1194
1466
  color?: string;
1195
- bold?: string;
1467
+ bold?: boolean;
1196
1468
  }
1197
1469
  /**
1198
1470
  * Emphasis, written *text* in Markdown. Italic in a built-in font; an embedded font names its
@@ -1208,7 +1480,7 @@ export interface MarkdownEmAttr {
1208
1480
  export interface MarkdownDelAttr {
1209
1481
  font?: string;
1210
1482
  color?: string;
1211
- strike?: string;
1483
+ strike?: boolean;
1212
1484
  }
1213
1485
  /**
1214
1486
  * A table. Its columns are sized by their content: a column takes the width its cells need on one
@@ -1233,7 +1505,7 @@ export interface MarkdownTableAttr {
1233
1505
  export interface MarkdownThAttr {
1234
1506
  font?: string;
1235
1507
  fontSize?: string;
1236
- bold?: string;
1508
+ bold?: boolean;
1237
1509
  color?: string;
1238
1510
  align?: string;
1239
1511
  padding?: string;
@@ -1246,7 +1518,7 @@ export interface MarkdownThAttr {
1246
1518
  export interface MarkdownTdAttr {
1247
1519
  font?: string;
1248
1520
  fontSize?: string;
1249
- bold?: string;
1521
+ bold?: boolean;
1250
1522
  color?: string;
1251
1523
  align?: string;
1252
1524
  padding?: string;
@@ -1267,7 +1539,7 @@ export interface LayerAttr {
1267
1539
  * How opaque everything in the layer is, from 0 to 1. To fade one element, put it in a layer of
1268
1540
  * its own.
1269
1541
  */
1270
- opacity?: string;
1542
+ opacity?: number;
1271
1543
  transform?: string;
1272
1544
  /**
1273
1545
  * A rectangle that cuts off what the layer draws outside it: x y w h, in points from the top left
@@ -1287,6 +1559,26 @@ export interface LayerAttr {
1287
1559
  * The color of the text-at in the layer that sets none of its own. Defaults to the text token.
1288
1560
  */
1289
1561
  color?: string;
1562
+ /**
1563
+ * In a PDF/UA document, what the layer shows, which a screen reader reads as one figure at the
1564
+ * layer's place in the document: a layer before the layout before it, one after the layout after
1565
+ * it. Without alt a layer is decoration, as a header is, and a screen reader skips it with all
1566
+ * its text: a watermark, a running title, a logo's letters. A document without pdfua ignores it.
1567
+ */
1568
+ alt?: string;
1569
+ /**
1570
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1571
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1572
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1573
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1574
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1575
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1576
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1577
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1578
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1579
+ * on in a layers panel.
1580
+ */
1581
+ ocg?: string;
1290
1582
  }
1291
1583
  /**
1292
1584
  * Attributes of the `rect` element in a layer.
@@ -1309,6 +1601,19 @@ export interface RectAttr {
1309
1601
  * with no fill shows the shadow only outside it.
1310
1602
  */
1311
1603
  shadow?: string;
1604
+ /**
1605
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1606
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1607
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1608
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1609
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1610
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1611
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1612
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1613
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1614
+ * on in a layers panel.
1615
+ */
1616
+ ocg?: string;
1312
1617
  }
1313
1618
  /**
1314
1619
  * Attributes of the `circle` element in a layer.
@@ -1339,6 +1644,19 @@ export interface CircleAttr {
1339
1644
  * with no fill shows the shadow only outside it.
1340
1645
  */
1341
1646
  shadow?: string;
1647
+ /**
1648
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1649
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1650
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1651
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1652
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1653
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1654
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1655
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1656
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1657
+ * on in a layers panel.
1658
+ */
1659
+ ocg?: string;
1342
1660
  }
1343
1661
  /**
1344
1662
  * Attributes of the `ellipse` element in a layer.
@@ -1370,6 +1688,19 @@ export interface EllipseAttr {
1370
1688
  * with no fill shows the shadow only outside it.
1371
1689
  */
1372
1690
  shadow?: string;
1691
+ /**
1692
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1693
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1694
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1695
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1696
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1697
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1698
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1699
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1700
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1701
+ * on in a layers panel.
1702
+ */
1703
+ ocg?: string;
1373
1704
  }
1374
1705
  /**
1375
1706
  * Attributes of the `line` element in a layer.
@@ -1383,6 +1714,19 @@ export interface LineAttr {
1383
1714
  strokeWidth?: string;
1384
1715
  strokeDash?: string;
1385
1716
  lineCap?: string;
1717
+ /**
1718
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1719
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1720
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1721
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1722
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1723
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1724
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1725
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1726
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1727
+ * on in a layers panel.
1728
+ */
1729
+ ocg?: string;
1386
1730
  }
1387
1731
  /**
1388
1732
  * Attributes of the `path` element in a layer.
@@ -1395,13 +1739,27 @@ export interface PathAttr {
1395
1739
  strokeWidth?: string;
1396
1740
  strokeDash?: string;
1397
1741
  lineCap?: string;
1742
+ /**
1743
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1744
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1745
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1746
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1747
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1748
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1749
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1750
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1751
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1752
+ * on in a layers panel.
1753
+ */
1754
+ ocg?: string;
1398
1755
  }
1399
1756
  /**
1400
1757
  * Text at a fixed place on the page. It is the text of the layout, with the same defaults: the
1401
1758
  * document's font or Helvetica, 11pt and the text colour. It is one line unless told otherwise;
1402
1759
  * give width to cut it off at a width or to wrap it with max-lines. x and y place its box: the
1403
1760
  * top-left corner, or with anchor, an offset from that point of the page, where the box's matching
1404
- * point goes. {page} and {pages} in it count within the section, and a text that comes from data
1761
+ * point goes. {page} in it prints the page's number and {pages} how many pages its run has, as its
1762
+ * section's page-start, page-format and page-prefix number them, and a text that comes from data
1405
1763
  * belongs in the layout, since a longer text loses its end here without a warning.
1406
1764
  */
1407
1765
  export interface TextAtAttr {
@@ -1415,28 +1773,28 @@ export interface TextAtAttr {
1415
1773
  * Helvetica-Bold, Times-Roman becomes Times-Bold, Courier becomes Courier-Bold, and the oblique
1416
1774
  * and italic faces their bold forms. A custom font has no bold face to pick, so name one in font.
1417
1775
  */
1418
- bold?: string;
1776
+ bold?: boolean;
1419
1777
  color?: string;
1420
1778
  align?: string;
1421
1779
  /**
1422
1780
  * The distance between lines, as a factor of the font size: a number above 0, such as 1.5, or a
1423
1781
  * name from the line-height row of the tokens. Default 1.2, which is the token m.
1424
1782
  */
1425
- lineHeight?: string;
1783
+ lineHeight?: string | number;
1426
1784
  /**
1427
1785
  * The most lines drawn. Only whole lines are drawn, and the rest of the text is dropped. A text
1428
1786
  * in the layout has no cap by default and wraps at the width it has; the lines it drops take no
1429
1787
  * room, and a text that splits across pages keeps the cap across them. A text-at is one line by
1430
1788
  * default, and above 1 needs a width to wrap within.
1431
1789
  */
1432
- maxLines?: string;
1790
+ maxLines?: number;
1433
1791
  /**
1434
1792
  * End the last line drawn in an ellipsis when max-lines drops text, shortened to fit the width.
1435
1793
  * Off by default: the text stops at the end of a line. A text-at also ends a line in one when it
1436
1794
  * is cut off at its width. A text in the layout without max-lines is never cut, so there it has
1437
1795
  * no effect.
1438
1796
  */
1439
- ellipsis?: string;
1797
+ ellipsis?: boolean;
1440
1798
  /**
1441
1799
  * Width of the box. Without it the text is one line of the width its characters need, and align
1442
1800
  * has no effect; a long text runs on past the edge of the page, which cuts it off, but stays in
@@ -1444,6 +1802,19 @@ export interface TextAtAttr {
1444
1802
  * and max-lines above 1 wraps the text within it.
1445
1803
  */
1446
1804
  width?: string;
1805
+ /**
1806
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1807
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1808
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1809
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1810
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1811
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1812
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1813
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1814
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1815
+ * on in a layers panel.
1816
+ */
1817
+ ocg?: string;
1447
1818
  }
1448
1819
  /**
1449
1820
  * An image at a fixed place on the page. It needs width or height, and the other follows the
@@ -1459,6 +1830,19 @@ export interface ImgAtAttr {
1459
1830
  anchor?: string;
1460
1831
  width?: string;
1461
1832
  height?: string;
1833
+ /**
1834
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1835
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1836
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1837
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1838
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1839
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1840
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1841
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1842
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1843
+ * on in a layers panel.
1844
+ */
1845
+ ocg?: string;
1462
1846
  }
1463
1847
  /**
1464
1848
  * A barcode at a fixed place on the page. It needs width or height, and the other follows the
@@ -1481,13 +1865,26 @@ export interface BarcodeAtAttr {
1481
1865
  */
1482
1866
  height?: string;
1483
1867
  ec?: string;
1484
- hrt?: string;
1868
+ hrt?: boolean;
1485
1869
  color?: string;
1486
1870
  background?: string;
1487
1871
  x?: string;
1488
1872
  y?: string;
1489
1873
  anchor?: string;
1490
1874
  width?: string;
1875
+ /**
1876
+ * Puts the element, and everything in it, in an optional content group, which the viewer shows or
1877
+ * hides. print: printed, and not shown on screen. screen: shown on screen, and not printed. The
1878
+ * element keeps its room either way, so nothing moves. An element with a group inside an element
1879
+ * with another shows only where both show. Acrobat, Chrome and Firefox switch the groups; Preview
1880
+ * and Safari show everything, on screen and in print. Hidden content is still in the file, where
1881
+ * it can be selected and copied: it is not a way to keep anything secret. A link in print content
1882
+ * is drawn and does nothing, and a form field can't be in print content: use a frame with a
1883
+ * border for a box filled in by hand. With pdfa or pdfua on the output, everything shows. With
1884
+ * pdfx, the file is the print version: screen content stays in it, off, and a reader can turn it
1885
+ * on in a layers panel.
1886
+ */
1887
+ ocg?: string;
1491
1888
  }
1492
1889
  /**
1493
1890
  * The flowing content of a section. Elements stack down the page, and a new page starts when one
@@ -1538,3 +1935,97 @@ export interface ImageAttr {
1538
1935
  */
1539
1936
  src?: string;
1540
1937
  }
1938
+ /**
1939
+ * A file the PDF carries, under the name a reader shows. The SDK reads it from src, or it was
1940
+ * loaded on the engine under ref or, with no ref, under its own name. A file with no bytes is an
1941
+ * error, and so are two files with the same name.
1942
+ */
1943
+ export interface FileAttr {
1944
+ /**
1945
+ * The name a reader shows the file under and saves it as, such as invoice.xml. Each file of the
1946
+ * document has a name of its own.
1947
+ */
1948
+ name: string;
1949
+ /** A path the SDK reads the file from, when the file was not loaded on the engine. */
1950
+ src?: string;
1951
+ /** The key the file was loaded under on the engine, when that is not its name. */
1952
+ ref?: string;
1953
+ /**
1954
+ * The type of the file, such as text/xml, application/pdf or text/csv. Defaults to
1955
+ * application/octet-stream, which says only that it is a file.
1956
+ */
1957
+ mime?: string;
1958
+ /**
1959
+ * How the file relates to the document: source, data, alternative, supplement or unspecified, the
1960
+ * default. An e-invoice's XML is data.
1961
+ */
1962
+ relationship?: string;
1963
+ /** A line about the file, which a reader shows beside its name. */
1964
+ description?: string;
1965
+ }
1966
+ /**
1967
+ * Declares an ICC color profile that the profile attribute of output names: the profile of the
1968
+ * printing press a PDF/X file is made for, which the printer gives out. The SDK reads the file from
1969
+ * src, or the profile was loaded on the engine under ref or, with no ref, under its own name. The
1970
+ * engine bundles no press profile.
1971
+ */
1972
+ export interface ProfileAttr {
1973
+ /**
1974
+ * The name that the profile attribute of output uses to pick this profile: lowercase letters,
1975
+ * digits and -, starting with a letter.
1976
+ */
1977
+ name: string;
1978
+ /** The key the profile was loaded under on the engine, when that is not its name. */
1979
+ ref?: string;
1980
+ /**
1981
+ * A path the SDK reads the ICC profile from, when the profile was not loaded on the engine.
1982
+ */
1983
+ src?: string;
1984
+ }
1985
+ /**
1986
+ * One color of a gradient, at an offset along it.
1987
+ */
1988
+ export interface GradientStop {
1989
+ /**
1990
+ * Where the color is reached along the gradient, from 0% (the start) to 100% (the end). Stops go
1991
+ * in increasing order.
1992
+ */
1993
+ offset: string;
1994
+ /**
1995
+ * The color at the stop: hex, cmyk(), rgb(), hsl() or a color token. The stops of a gradient are
1996
+ * all CMYK or all RGB.
1997
+ */
1998
+ color: string;
1999
+ }
2000
+ /**
2001
+ * A named blend of colors. A background or a fill uses it as gradient:name, and the blend spans the
2002
+ * box it fills. Give from and to for two colors, or stop children for more.
2003
+ */
2004
+ export interface GradientToken {
2005
+ /**
2006
+ * linear runs along a line across the box. radial runs from the center out to the farthest
2007
+ * corner.
2008
+ */
2009
+ type: 'linear' | 'radial';
2010
+ /**
2011
+ * The first color: hex, cmyk(), rgb(), hsl() or a color token, CMYK if to is and RGB if it is
2012
+ * not. Used with to, when there are no stop children. For a radial gradient it is the center.
2013
+ */
2014
+ from?: string;
2015
+ /**
2016
+ * The last color: hex, cmyk(), rgb(), hsl() or a color token. Used with from, when there are no
2017
+ * stop children. For a radial gradient it is the edge.
2018
+ */
2019
+ to?: string;
2020
+ /**
2021
+ * The direction of a linear gradient, in degrees: 0 runs from the top to the bottom, 90 from the
2022
+ * left to the right, 180 from the bottom to the top. Default 0. A radial gradient has no
2023
+ * direction.
2024
+ */
2025
+ angle?: number;
2026
+ /**
2027
+ * The colors of the gradient, for more than two: each at an offset, in increasing order. Give
2028
+ * these, or from and to.
2029
+ */
2030
+ stops?: GradientStop[];
2031
+ }