@yudaocode/univer-pdfs 0.0.0-stage → 1.6.205

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.
@@ -0,0 +1,1484 @@
1
+ import { LocaleType } from '@univerjs/core';
2
+
3
+ declare const UNIVER_PDF_SCHEMA: "univer-pdf-unit";
4
+ declare const UNIVER_PDF_SCHEMA_VERSION: 1;
5
+ /** 1 PostScript point = 1/72 inch; 1 inch = 25.4 mm */
6
+ declare const PT_PER_MM: number;
7
+ declare function mmToPt(mm: number): number;
8
+ declare function ptToMm(pt: number): number;
9
+ type PdfDisplayUnit = 'pt' | 'mm';
10
+ type PdfColorSpaceType = 'rgb' | 'cmyk';
11
+ interface IPdfjsAssetsConfig {
12
+ workerSrc?: string;
13
+ cMapUrl?: string;
14
+ cMapPacked?: boolean;
15
+ standardFontDataUrl?: string;
16
+ disableWorker?: boolean;
17
+ }
18
+ declare const PdfListKind: {
19
+ readonly BULLET: "bullet";
20
+ readonly ORDERED: "ordered";
21
+ readonly CHECK: "check";
22
+ };
23
+ type PdfListKind = (typeof PdfListKind)[keyof typeof PdfListKind];
24
+ declare const PdfListPresetId: {
25
+ readonly BULLET_DISC: "bullet-disc";
26
+ readonly BULLET_CIRCLE: "bullet-circle";
27
+ readonly BULLET_SQUARE: "bullet-square";
28
+ readonly DECIMAL: "decimal";
29
+ readonly UPPER_ALPHA: "upper-alpha";
30
+ readonly LOWER_ALPHA: "lower-alpha";
31
+ readonly UPPER_ROMAN: "upper-roman";
32
+ readonly LOWER_ROMAN: "lower-roman";
33
+ readonly CHECKLIST: "checklist";
34
+ };
35
+ type PdfListPresetId = (typeof PdfListPresetId)[keyof typeof PdfListPresetId];
36
+ declare const PdfTextAnchor: {
37
+ readonly TOP_LEFT: "top-left";
38
+ readonly TOP_CENTER: "top-center";
39
+ readonly TOP_RIGHT: "top-right";
40
+ readonly MIDDLE_LEFT: "middle-left";
41
+ readonly CENTER: "center";
42
+ readonly MIDDLE_RIGHT: "middle-right";
43
+ readonly BOTTOM_LEFT: "bottom-left";
44
+ readonly BOTTOM_CENTER: "bottom-center";
45
+ readonly BOTTOM_RIGHT: "bottom-right";
46
+ };
47
+ type PdfTextAnchor = (typeof PdfTextAnchor)[keyof typeof PdfTextAnchor];
48
+ declare const PdfTableCellVerticalAlign: {
49
+ readonly TOP: "top";
50
+ readonly MIDDLE: "middle";
51
+ readonly BOTTOM: "bottom";
52
+ };
53
+ type PdfTableCellVerticalAlign = (typeof PdfTableCellVerticalAlign)[keyof typeof PdfTableCellVerticalAlign];
54
+ interface IPdfTableThemePreset {
55
+ id: string;
56
+ name: string;
57
+ borderColor: string;
58
+ borderWidth: number;
59
+ headerBackgroundColor: string;
60
+ headerTextColor: string;
61
+ bodyBackgroundColor?: string;
62
+ bodyTextColor: string;
63
+ zebraStripeColor?: string;
64
+ }
65
+ declare const PDF_TABLE_THEME_PRESETS: readonly IPdfTableThemePreset[];
66
+ interface IPdfPageSize {
67
+ /** Page width in PostScript points (pt) */
68
+ width: number;
69
+ /** Page height in PostScript points (pt) */
70
+ height: number;
71
+ preset?: 'A4' | 'A4_LANDSCAPE' | 'A5' | 'LETTER' | 'RECEIPT_80MM' | 'INVOICE_240_140' | 'INVOICE_240_93' | 'CUSTOM';
72
+ }
73
+ declare const PDF_PAGE_PRESETS: Record<NonNullable<IPdfPageSize['preset']>, IPdfPageSize>;
74
+ interface IPdfSourceDocumentRef {
75
+ id: string;
76
+ fileName?: string;
77
+ mimeType: 'application/pdf';
78
+ /** Base64 Data URI or URL of imported source PDF */
79
+ dataUri?: string;
80
+ pageCount?: number;
81
+ }
82
+ interface IPdfResourceBinding {
83
+ id: string;
84
+ type: 'image' | 'pdf' | 'font';
85
+ name?: string;
86
+ mimeType: string;
87
+ dataUri: string;
88
+ }
89
+ type PdfPageRotation = 0 | 90 | 180 | 270;
90
+ interface IPdfCropBox {
91
+ left: number;
92
+ top: number;
93
+ width: number;
94
+ height: number;
95
+ }
96
+ interface IPdfPage {
97
+ id: string;
98
+ title?: string;
99
+ /** Optional per-page size override; falls back to document.pageSize */
100
+ pageSize?: IPdfPageSize;
101
+ /** 1-based page index in sourceDocumentRef if backed by an imported PDF */
102
+ sourcePageNumber?: number;
103
+ backgroundColor?: string;
104
+ /** Clockwise page rotation in degrees (`0 | 90 | 180 | 270`) */
105
+ rotation?: PdfPageRotation;
106
+ /** Optional page crop box in top-left PostScript points */
107
+ cropBox?: IPdfCropBox;
108
+ }
109
+ interface IPdfDocument {
110
+ pageSize: IPdfPageSize;
111
+ /** Optional printable page margin guides in pt [top, right, bottom, left] */
112
+ margins?: [number, number, number, number];
113
+ pages: Record<string, IPdfPage>;
114
+ pageOrder: string[];
115
+ metadata?: {
116
+ staticSchemaElements?: IPdfPageElement[];
117
+ [key: string]: unknown;
118
+ };
119
+ }
120
+ declare enum PdfElementType {
121
+ TEXT = "text",
122
+ LIST = "list",
123
+ IMAGE = "image",
124
+ SVG = "svg",
125
+ TABLE = "table",
126
+ QRCODE = "qrcode",
127
+ BARCODE = "barcode",
128
+ SHAPE = "shape",
129
+ LINE = "line",
130
+ ELLIPSE = "ellipse",
131
+ POLYGON = "polygon",
132
+ STAMP = "stamp",
133
+ INK = "ink",
134
+ CHECKBOX = "checkbox",
135
+ CIRCLE_MARK = "circleMark",
136
+ RADIO_GROUP = "radioGroup",
137
+ SELECT = "select",
138
+ DATE_TIME = "dateTime",
139
+ SIGNATURE = "signature",
140
+ ANNOTATION = "annotation",
141
+ REDACTION = "redaction"
142
+ }
143
+ type PdfInteractionMode = 'select' | 'pan' | 'ink' | 'form';
144
+ type PdfBarcodeFormat = 'CODE128' | 'EAN13' | 'EAN8' | 'UPC' | 'UPCA' | 'UPCE' | 'CODE39' | 'ITF14' | 'NW7' | 'CODABAR' | 'JAPANPOST' | 'GS1_128' | 'DATAMATRIX' | 'GS1_DATAMATRIX' | 'GS1DATAMATRIX' | 'PDF417' | 'QRCODE' | 'qrcode' | 'japanpost' | 'ean13' | 'ean8' | 'code39' | 'code128' | 'nw7' | 'codabar' | 'itf14' | 'upca' | 'upce' | 'upc' | 'gs1datamatrix' | 'gs1-128' | 'gs1_128' | 'datamatrix' | 'pdf417';
145
+ type PdfTextOverflowMode = 'clip' | 'shrink' | 'expand';
146
+ type PdfDateTimeKind = 'date' | 'time' | 'dateTime';
147
+ interface IPdfElementTransform {
148
+ /** X coordinate in pt from top-left of page */
149
+ left: number;
150
+ /** Y coordinate in pt from top-left of page */
151
+ top: number;
152
+ /** Width in pt */
153
+ width: number;
154
+ /** Height in pt */
155
+ height: number;
156
+ /** Clockwise rotation in degrees */
157
+ angle?: number;
158
+ /** Mirror horizontally around element center */
159
+ flipX?: boolean;
160
+ /** Mirror vertically around element center */
161
+ flipY?: boolean;
162
+ }
163
+ interface IPdfTextStyle {
164
+ fontFamily?: string;
165
+ fontSize?: number;
166
+ fontWeight?: 'normal' | 'bold';
167
+ italic?: boolean;
168
+ underline?: boolean;
169
+ strikethrough?: boolean;
170
+ characterSpacing?: number;
171
+ color?: string;
172
+ backgroundColor?: string;
173
+ borderColor?: string;
174
+ borderWidth?: number;
175
+ borderRadius?: number;
176
+ textAlign?: 'left' | 'center' | 'right' | 'justify';
177
+ verticalAlign?: 'top' | 'middle' | 'bottom';
178
+ lineHeight?: number;
179
+ padding?: number;
180
+ }
181
+ type PdfDynamicFontFitMode = 'horizontal' | 'vertical';
182
+ interface IPdfDynamicFontSizeConfig {
183
+ min: number;
184
+ max: number;
185
+ fit?: PdfDynamicFontFitMode;
186
+ }
187
+ interface IPdfParagraphBlock {
188
+ text: string;
189
+ style?: Partial<IPdfTextStyle>;
190
+ }
191
+ declare const PdfImageSourceType: {
192
+ readonly DATA_URI: "data-uri";
193
+ readonly URL: "url";
194
+ readonly RESOURCE: "resource";
195
+ readonly EMPTY: "empty";
196
+ };
197
+ type PdfImageSourceType = (typeof PdfImageSourceType)[keyof typeof PdfImageSourceType];
198
+ declare const PdfTableBorderStyle: {
199
+ readonly SOLID: "solid";
200
+ readonly DASHED: "dashed";
201
+ readonly DOTTED: "dotted";
202
+ };
203
+ type PdfTableBorderStyle = (typeof PdfTableBorderStyle)[keyof typeof PdfTableBorderStyle];
204
+ interface IPdfTableBorderWidths {
205
+ top: number;
206
+ right: number;
207
+ bottom: number;
208
+ left: number;
209
+ }
210
+ interface IPdfTableMerge {
211
+ /** 0-based body row index */
212
+ row: number;
213
+ /** 0-based column index */
214
+ col: number;
215
+ /** Number of spanned rows (>= 1) */
216
+ rowSpan: number;
217
+ /** Number of spanned columns (>= 1) */
218
+ colSpan: number;
219
+ }
220
+ interface IPdfTableCellStyle extends IPdfTextStyle {
221
+ borderStyle?: PdfTableBorderStyle;
222
+ borderWidths?: Partial<IPdfTableBorderWidths>;
223
+ }
224
+ interface IPdfRichTextSpan {
225
+ text: string;
226
+ bold?: boolean;
227
+ italic?: boolean;
228
+ color?: string;
229
+ fontSize?: number;
230
+ underline?: boolean;
231
+ strikethrough?: boolean;
232
+ code?: boolean;
233
+ backgroundColor?: string;
234
+ linkUrl?: string;
235
+ linkDest?: string;
236
+ linkPageIndex?: number;
237
+ }
238
+ interface IPdfTableColumn {
239
+ id: string;
240
+ header: string;
241
+ /** Dataset property key for dynamic row rendering, e.g. 'itemName' */
242
+ field: string;
243
+ /** Relative column width weight (e.g. 1, 2, 3) */
244
+ widthRatio: number;
245
+ align?: 'left' | 'center' | 'right';
246
+ verticalAlign?: PdfTableCellVerticalAlign;
247
+ format?: 'text' | 'number' | 'currency' | 'percent';
248
+ decimals?: number;
249
+ currencySymbol?: string;
250
+ summaryType?: 'none' | 'sum' | 'avg' | 'count';
251
+ }
252
+ interface IPdfImageCrop {
253
+ /** Left inset ratio (0..0.9) */
254
+ left: number;
255
+ /** Top inset ratio (0..0.9) */
256
+ top: number;
257
+ /** Right inset ratio (0..0.9) */
258
+ right: number;
259
+ /** Bottom inset ratio (0..0.9) */
260
+ bottom: number;
261
+ }
262
+ declare function normalizeImageCrop(crop?: Partial<IPdfImageCrop> | null): IPdfImageCrop;
263
+ interface IPdfLayer {
264
+ id: string;
265
+ name: string;
266
+ visible: boolean;
267
+ locked?: boolean;
268
+ printable?: boolean;
269
+ }
270
+ interface IPdfPageElementBase {
271
+ id: string;
272
+ type: PdfElementType;
273
+ name?: string;
274
+ transform: IPdfElementTransform;
275
+ opacity?: number;
276
+ locked?: boolean;
277
+ hidden?: boolean;
278
+ /** Optional Optional-Content-Group (`/OCProperties`) layer assignment */
279
+ layerId?: string;
280
+ /** Optional accessibility `/Alt` alternate text description (PDF/UA) */
281
+ altText?: string;
282
+ /** Optional report dataset binding path, e.g. 'order.orderNo' or 'items' */
283
+ bindingField?: string;
284
+ /** Optional interactive form field key (`pdfme` Form parity) */
285
+ fieldKey?: string;
286
+ /** Optional explicit AcroForm field name (`/T`) */
287
+ formFieldName?: string;
288
+ required?: boolean;
289
+ /** Optional regex validation pattern for interactive form fields */
290
+ validationPattern?: string;
291
+ /** Optional arithmetic calculation formula across named form fields, e.g. `=qty * price` */
292
+ calcExpression?: string;
293
+ /** Optional numeric formatting mode for calculated/formatted form fields */
294
+ valueFormat?: 'text' | 'number' | 'currency' | 'percent';
295
+ /** Optional decimal precision for calculated/formatted form fields */
296
+ decimals?: number;
297
+ /** Optional external URI action (`/Annot /Subtype /Link`) or `#elementName` internal anchor */
298
+ linkUrl?: string;
299
+ /** Optional internal element name/ID or bookmark destination (`/GoTo`) */
300
+ linkDest?: string;
301
+ /** Optional 0-based internal target page destination (`/Annot /Subtype /Link`) */
302
+ linkPageIndex?: number;
303
+ /** Optional element-level horizontal mirror flag */
304
+ flipX?: boolean;
305
+ /** Optional element-level vertical mirror flag */
306
+ flipY?: boolean;
307
+ /** Optional color space emission mode (`'rgb'` default or print `'cmyk'`) */
308
+ colorType?: PdfColorSpaceType;
309
+ metadata?: Record<string, unknown>;
310
+ }
311
+ type IPdfElementBase = IPdfPageElementBase;
312
+ type PdfTextFormatMode = 'plain' | 'inline-markdown';
313
+ interface IPdfTextElement extends IPdfPageElementBase {
314
+ type: PdfElementType.TEXT;
315
+ content: string;
316
+ /** Text formatting mode: `'plain'` (default) or `'inline-markdown'` (`**bold**`, `*italic*`, `~~strike~~`, `` `code` ``, `[label](url|#dest)`) */
317
+ textFormat?: PdfTextFormatMode;
318
+ /** Optional 9-way text anchor alignment */
319
+ anchor?: PdfTextAnchor;
320
+ /** Overflow layout behavior: `'clip'`, `'shrink'` (dynamic font size), or `'expand'` (dynamic height) */
321
+ overflow?: PdfTextOverflowMode;
322
+ /** Automatically shrink font size when text exceeds box dimensions (`pdfme` `dynamicFontSize` parity) */
323
+ autoFitFontSize?: boolean;
324
+ minFontSize?: number;
325
+ /** Bidirectional dynamic font sizing configuration (`{ min, max, fit: 'horizontal' | 'vertical' }`) */
326
+ dynamicFontSize?: IPdfDynamicFontSizeConfig;
327
+ /** Inline mixed-style rich text spans (`@pdfme/schemas` `multiVariableText` parity) */
328
+ richSpans?: IPdfRichTextSpan[];
329
+ /** Multi-column text flow inside the bounding box (`1 | 2 | 3`) */
330
+ columns?: number;
331
+ /** Horizontal gap in points between multi-column text columns (default `12`) */
332
+ columnGapPt?: number;
333
+ /** Explicit variable key list for `multiVariableText` templates */
334
+ variables?: string[];
335
+ /** Required template variable paths validated via `validatePdfTemplateVariables` */
336
+ requiredVariables?: string[];
337
+ style?: IPdfTextStyle;
338
+ }
339
+ interface IPdfImageElement extends IPdfPageElementBase {
340
+ type: PdfElementType.IMAGE;
341
+ src?: string;
342
+ resourceId?: string;
343
+ fit?: 'contain' | 'cover' | 'fill';
344
+ /** 9-way object alignment within frame (`'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'`) */
345
+ objectPosition?: string;
346
+ /** Non-destructive display area crop inset ratios (`0..0.9` from each edge) */
347
+ crop?: IPdfImageCrop;
348
+ borderColor?: string;
349
+ borderWidth?: number;
350
+ borderRadius?: number;
351
+ }
352
+ interface IPdfTableElement extends IPdfPageElementBase {
353
+ type: PdfElementType.TABLE;
354
+ columns: IPdfTableColumn[];
355
+ /** Sample/static rows when no dynamic dataset rows are supplied */
356
+ rows?: string[][];
357
+ /** Whether to display and reserve space for the table header row (`true` by default) */
358
+ showHead?: boolean;
359
+ headerHeight?: number;
360
+ rowHeight?: number;
361
+ borderColor?: string;
362
+ borderWidth?: number;
363
+ /** Table grid line style (`'solid'` default, `'dashed'`, or `'dotted'`) */
364
+ borderStyle?: PdfTableBorderStyle;
365
+ /** Optional per-side cell border widths in PostScript points (`{ top, right, bottom, left }`) */
366
+ borderWidths?: IPdfTableBorderWidths;
367
+ /** Cell span merge descriptors (`row`, `col`, `rowSpan`, `colSpan`) */
368
+ merges?: IPdfTableMerge[];
369
+ /** Per-cell style overrides keyed by `'rowIndex:colIndex'` (e.g. `'0:1'`) */
370
+ cellStyles?: Record<string, IPdfTableCellStyle>;
371
+ stripedColor?: string;
372
+ /** Alternating even/odd body row background fill color */
373
+ zebraStripeColor?: string;
374
+ /** Prevents a table header from rendering alone at the bottom of a page without at least one body row */
375
+ avoidOrphanHeader?: boolean;
376
+ /** Appends a per-page subtotal row at the bottom of each page aggregating only that page's rows */
377
+ showPageSubtotal?: boolean;
378
+ /** Label for the per-page subtotal row (default `'本页小计'`) */
379
+ pageSubtotalLabel?: string;
380
+ /** Appends a grand-total row at the end of the final page aggregating all rows across all pages */
381
+ showGrandTotal?: boolean;
382
+ /** Label for the grand-total row (default `'总计'`) */
383
+ grandTotalLabel?: string;
384
+ headerStyle?: IPdfTextStyle;
385
+ bodyStyle?: IPdfTextStyle;
386
+ }
387
+ interface IPdfQrCodeElement extends IPdfPageElementBase {
388
+ type: PdfElementType.QRCODE;
389
+ content: string;
390
+ foregroundColor?: string;
391
+ backgroundColor?: string;
392
+ }
393
+ interface IPdfBarcodeElement extends IPdfPageElementBase {
394
+ type: PdfElementType.BARCODE;
395
+ content: string;
396
+ barcodeFormat?: PdfBarcodeFormat;
397
+ displayValue?: boolean;
398
+ foregroundColor?: string;
399
+ /** Optional explicit bar color alias (falls back to `foregroundColor`) */
400
+ barColor?: string;
401
+ /** Independent human-readable label text color (falls back to `foregroundColor`) */
402
+ textColor?: string;
403
+ backgroundColor?: string;
404
+ }
405
+ interface IPdfSvgElement extends IPdfPageElementBase {
406
+ type: PdfElementType.SVG;
407
+ svgContent: string;
408
+ }
409
+ interface IPdfCheckboxElement extends IPdfPageElementBase {
410
+ type: PdfElementType.CHECKBOX;
411
+ label: string;
412
+ checked: boolean;
413
+ style?: IPdfTextStyle;
414
+ }
415
+ interface IPdfCircleMarkElement extends IPdfPageElementBase {
416
+ type: PdfElementType.CIRCLE_MARK;
417
+ checked?: boolean;
418
+ content?: 'true' | 'false' | string;
419
+ strokeColor?: string;
420
+ strokeWidthMm?: number;
421
+ }
422
+ interface IPdfDateTimeElement extends IPdfPageElementBase {
423
+ type: PdfElementType.DATE_TIME;
424
+ dateKind: PdfDateTimeKind;
425
+ format: string;
426
+ value: string;
427
+ fontSize?: number;
428
+ color?: string;
429
+ backgroundColor?: string;
430
+ align?: 'left' | 'center' | 'right';
431
+ characterSpacing?: number;
432
+ locale?: string;
433
+ style?: IPdfTextStyle;
434
+ }
435
+ interface IPdfRadioGroupElement extends IPdfPageElementBase {
436
+ type: PdfElementType.RADIO_GROUP;
437
+ options: string[];
438
+ value: string;
439
+ direction?: 'horizontal' | 'vertical';
440
+ style?: IPdfTextStyle;
441
+ }
442
+ interface IPdfSelectElement extends IPdfPageElementBase {
443
+ type: PdfElementType.SELECT;
444
+ options: string[];
445
+ value: string;
446
+ placeholder?: string;
447
+ style?: IPdfTextStyle;
448
+ }
449
+ interface IPdfShapeElement extends IPdfPageElementBase {
450
+ type: PdfElementType.SHAPE;
451
+ shapeType: 'rect' | 'line' | 'ellipse' | 'highlight';
452
+ fillColor?: string;
453
+ strokeColor?: string;
454
+ strokeWidth?: number;
455
+ borderRadius?: number;
456
+ startArrow?: boolean;
457
+ endArrow?: boolean;
458
+ dashArray?: number[];
459
+ }
460
+ interface IPdfLineElement extends IPdfPageElementBase {
461
+ type: PdfElementType.LINE;
462
+ strokeColor?: string;
463
+ strokeWidth?: number;
464
+ startArrow?: boolean;
465
+ endArrow?: boolean;
466
+ dashArray?: number[];
467
+ }
468
+ interface IPdfEllipseElement extends IPdfPageElementBase {
469
+ type: PdfElementType.ELLIPSE;
470
+ strokeColor?: string;
471
+ strokeWidth?: number;
472
+ fillColor?: string;
473
+ dashArray?: number[];
474
+ }
475
+ interface IPdfPolygonPoint {
476
+ /** Normalized X coordinate (0..1 relative to bounding box width) */
477
+ x: number;
478
+ /** Normalized Y coordinate (0..1 relative to bounding box height) */
479
+ y: number;
480
+ }
481
+ interface IPdfPolygonElement extends IPdfPageElementBase {
482
+ type: PdfElementType.POLYGON;
483
+ /** Explicit normalized vertices (0..1 relative to bounding box) */
484
+ points?: IPdfPolygonPoint[];
485
+ /** Regular polygon vertex count preset (e.g. 3, 5, 6, 8) when `points` is omitted */
486
+ sides?: number;
487
+ /** Optional star inner-radius ratio (0..1) when generating star presets */
488
+ innerRadiusRatio?: number;
489
+ strokeColor?: string;
490
+ strokeWidth?: number;
491
+ fillColor?: string;
492
+ dashArray?: number[];
493
+ }
494
+ /**
495
+ * Resolves normalized `0..1` vertices for an `IPdfPolygonElement`, supporting explicit `points`
496
+ * or regular polygon / star presets via `sides` and `innerRadiusRatio`.
497
+ */
498
+ declare function resolvePolygonNormalizedPoints(points?: IPdfPolygonPoint[], sides?: number, innerRadiusRatio?: number): IPdfPolygonPoint[];
499
+ interface IPdfListElement extends IPdfPageElementBase {
500
+ type: PdfElementType.LIST;
501
+ listType: 'bullet' | 'ordered' | 'check';
502
+ presetId?: PdfListPresetId;
503
+ overflow?: 'clip' | 'expand';
504
+ /** Starting sequence number for `'ordered'` lists (`1` by default) */
505
+ startNumber?: number;
506
+ /** Per-item nesting indentation level (`0..8`) */
507
+ itemLevels?: number[];
508
+ items: string[];
509
+ style?: IPdfTextStyle;
510
+ }
511
+ interface IPdfStampElement extends IPdfPageElementBase {
512
+ type: PdfElementType.STAMP;
513
+ stampShape?: 'oval' | 'circle' | 'rect';
514
+ primaryText: string;
515
+ secondaryText?: string;
516
+ color?: string;
517
+ }
518
+ interface IPdfInkPoint {
519
+ /** Normalized X (0..width in pt relative to element left) */
520
+ x: number;
521
+ /** Normalized Y (0..height in pt relative to element top) */
522
+ y: number;
523
+ }
524
+ interface IPdfInkElement extends IPdfPageElementBase {
525
+ type: PdfElementType.INK;
526
+ paths: IPdfInkPoint[][];
527
+ strokeColor: string;
528
+ strokeWidth: number;
529
+ }
530
+ declare const PdfAnnotationType: {
531
+ readonly HIGHLIGHT: "highlight";
532
+ readonly UNDERLINE: "underline";
533
+ readonly STRIKEOUT: "strikeout";
534
+ readonly SQUIGGLY: "squiggly";
535
+ readonly STICKY_NOTE: "stickyNote";
536
+ };
537
+ type PdfAnnotationType = (typeof PdfAnnotationType)[keyof typeof PdfAnnotationType];
538
+ type PdfAnnotationStatus = 'open' | 'accepted' | 'rejected' | 'resolved';
539
+ interface IPdfAnnotationReply {
540
+ id: string;
541
+ author: string;
542
+ content: string;
543
+ createdAt: string;
544
+ }
545
+ interface IPdfAnnotationElement extends IPdfPageElementBase {
546
+ type: PdfElementType.ANNOTATION;
547
+ annotationType: PdfAnnotationType;
548
+ color?: string;
549
+ opacity?: number;
550
+ author?: string;
551
+ comment?: string;
552
+ status?: PdfAnnotationStatus;
553
+ replies?: IPdfAnnotationReply[];
554
+ }
555
+ interface IPdfSignatureElement extends IPdfPageElementBase {
556
+ type: PdfElementType.SIGNATURE;
557
+ label?: string;
558
+ signerName?: string;
559
+ signedAt?: string;
560
+ reason?: string;
561
+ signatureDataUri?: string;
562
+ style?: IPdfTextStyle;
563
+ }
564
+ interface IPdfRedactionElement extends IPdfPageElementBase {
565
+ type: PdfElementType.REDACTION;
566
+ fillColor?: string;
567
+ overlayLabel?: string;
568
+ }
569
+ type IPdfPageElement = IPdfTextElement | IPdfListElement | IPdfImageElement | IPdfSvgElement | IPdfTableElement | IPdfQrCodeElement | IPdfBarcodeElement | IPdfShapeElement | IPdfLineElement | IPdfEllipseElement | IPdfPolygonElement | IPdfStampElement | IPdfInkElement | IPdfCheckboxElement | IPdfCircleMarkElement | IPdfRadioGroupElement | IPdfSelectElement | IPdfDateTimeElement | IPdfSignatureElement | IPdfAnnotationElement | IPdfRedactionElement;
570
+ type IPdfElement = IPdfPageElement;
571
+ interface IPdfNativeTextSpan {
572
+ id: string;
573
+ pageId: string;
574
+ pageIndex: number;
575
+ text: string;
576
+ left: number;
577
+ top: number;
578
+ width: number;
579
+ height: number;
580
+ fontSize: number;
581
+ suppressed?: boolean;
582
+ /** True when injected by OCR `searchable` mode so exporter emits invisible `3 Tr` searchable text */
583
+ ocrSearchable?: boolean;
584
+ confidence?: number;
585
+ }
586
+ interface IPdfBookmarkItem {
587
+ id: string;
588
+ title: string;
589
+ /** 0-based target page index */
590
+ pageIndex: number;
591
+ /** Optional vertical offset in pt from top of target page */
592
+ topOffsetPt?: number;
593
+ children?: IPdfBookmarkItem[];
594
+ }
595
+ type PdfBatesPosition = 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft';
596
+ interface IPdfBatesConfig {
597
+ enabled?: boolean;
598
+ prefix?: string;
599
+ suffix?: string;
600
+ startNumber?: number;
601
+ digits?: number;
602
+ position?: PdfBatesPosition;
603
+ }
604
+ interface IPdfHeaderFooterConfig {
605
+ enabled?: boolean;
606
+ headerLeft?: string;
607
+ headerCenter?: string;
608
+ headerRight?: string;
609
+ footerLeft?: string;
610
+ footerCenter?: string;
611
+ footerRight?: string;
612
+ fontSize?: number;
613
+ color?: string;
614
+ marginPt?: number;
615
+ skipFirstPage?: boolean;
616
+ }
617
+ interface IPdfWatermarkConfig {
618
+ enabled?: boolean;
619
+ text?: string;
620
+ fontSize?: number;
621
+ color?: string;
622
+ opacity?: number;
623
+ angle?: number;
624
+ tiled?: boolean;
625
+ }
626
+ interface IPdfAttachment {
627
+ id: string;
628
+ fileName: string;
629
+ mimeType: string;
630
+ dataBase64: string;
631
+ description?: string;
632
+ }
633
+ interface IPdfSecurityPermissions {
634
+ openPasswordHash?: string;
635
+ ownerPasswordHash?: string;
636
+ allowPrint?: boolean;
637
+ allowCopy?: boolean;
638
+ allowModify?: boolean;
639
+ allowAnnotate?: boolean;
640
+ }
641
+ interface IPdfSignerInfo {
642
+ signerName: string;
643
+ certificateSubject?: string;
644
+ certificateIssuer?: string;
645
+ certificateSerial?: string;
646
+ certificateFingerprintSha256?: string;
647
+ reason?: string;
648
+ location?: string;
649
+ contactInfo?: string;
650
+ signedAt?: string;
651
+ }
652
+ interface IPdfSignatureEnvelope {
653
+ version: 1;
654
+ algorithm: 'SHA-256';
655
+ contentDigestHex: string;
656
+ envelopeDigestHex: string;
657
+ signerName: string;
658
+ certificateSubject: string;
659
+ certificateIssuer: string;
660
+ certificateSerial: string;
661
+ certificateFingerprintSha256: string;
662
+ reason?: string;
663
+ location?: string;
664
+ contactInfo?: string;
665
+ signedAt: string;
666
+ }
667
+ interface IPdfDurableEditState {
668
+ /** Page ID -> Element ID -> Element definition */
669
+ elementsByPage: Record<string, Record<string, IPdfPageElement>>;
670
+ /** Page ID -> z-order Element ID array (bottom to top) */
671
+ elementOrderByPage: Record<string, string[]>;
672
+ /** Optional source object suppression list when editing imported PDFs */
673
+ suppressedSourceIds?: string[];
674
+ /** Extracted native text spans from imported base PDF pages */
675
+ nativeTextSpansByPage?: Record<string, IPdfNativeTextSpan[]>;
676
+ }
677
+ interface IPdfDatasetField {
678
+ key: string;
679
+ label: string;
680
+ type: 'text' | 'number' | 'image' | 'qrcode' | 'barcode' | 'table';
681
+ sampleValue?: unknown;
682
+ /** Child columns if type === 'table' */
683
+ columns?: Array<{
684
+ field: string;
685
+ header: string;
686
+ align?: 'left' | 'center' | 'right';
687
+ widthRatio?: number;
688
+ }>;
689
+ }
690
+ interface IPdfDatasetSchema {
691
+ code: string;
692
+ name: string;
693
+ fields: IPdfDatasetField[];
694
+ }
695
+ interface IPdfUnitMetadata {
696
+ datasets?: IPdfDatasetSchema[];
697
+ sampleData?: Record<string, unknown>;
698
+ /** Semi-transparent diagonal anti-tamper watermark text stamped across exported pages */
699
+ watermarkText?: string;
700
+ /** Structured watermark configuration */
701
+ watermarkConfig?: IPdfWatermarkConfig;
702
+ /** Structured page header & footer configuration */
703
+ headerFooterConfig?: IPdfHeaderFooterConfig;
704
+ /** Static overlay elements (`pdfme` `BlankPdf.staticSchema` parity) stamped on every physical output page */
705
+ staticSchemaElements?: IPdfPageElement[];
706
+ /** Default document color space emission mode (`'rgb'` default or `'cmyk'`) */
707
+ colorType?: PdfColorSpaceType;
708
+ /** Strip imported base PDF background on export/print (needle-printer physical pre-printed form mode) */
709
+ excludeBasePdfOnExport?: boolean;
710
+ /** Starting page number offset for `{{page}} / {{totalPages}}` tokens */
711
+ startPageNumber?: number;
712
+ /** Extracted native text spans from imported base PDF pages */
713
+ nativeTextSpansByPage?: Record<string, IPdfNativeTextSpan[]>;
714
+ /** Navigable PDF outline bookmark tree (`/Outlines`) */
715
+ bookmarks?: IPdfBookmarkItem[];
716
+ /** Automatic legal & archive Bates numbering configuration */
717
+ batesConfig?: IPdfBatesConfig;
718
+ /** Embedded file attachments (`/EmbeddedFiles`) */
719
+ attachments?: IPdfAttachment[];
720
+ /** Document security & permission restrictions */
721
+ securityPermissions?: IPdfSecurityPermissions;
722
+ /** Digital signature SHA-256 envelope */
723
+ signatureEnvelope?: IPdfSignatureEnvelope;
724
+ /** Emit PDF/A-1b XMP Dublin Core metadata & `/OutputIntents` */
725
+ pdfACompliant?: boolean;
726
+ /** Emit PDF/UA `/MarkInfo << /Marked true >>` & `/StructTreeRoot` tagged accessibility tree */
727
+ accessibilityTagged?: boolean;
728
+ /** True after `sanitizePdfUnit` strips hidden metadata */
729
+ sanitized?: boolean;
730
+ [key: string]: unknown;
731
+ }
732
+ type IPdfDocumentMetadata = IPdfUnitMetadata;
733
+ /**
734
+ * Core Univer PDF Unit Snapshot Contract (`IPdfUnitData` / `IPdfDocumentData`).
735
+ * Decouples immutable `document` & `sourceDocumentRef` baseline from `editState` & `resourceBindings`.
736
+ */
737
+ interface IPdfUnitData {
738
+ schema: typeof UNIVER_PDF_SCHEMA;
739
+ schemaVersion: typeof UNIVER_PDF_SCHEMA_VERSION;
740
+ id: string;
741
+ rev: number;
742
+ name: string;
743
+ locale?: LocaleType;
744
+ sourceDocumentRef?: IPdfSourceDocumentRef;
745
+ document: IPdfDocument;
746
+ editState: IPdfDurableEditState;
747
+ /** Optional named PDF Optional Content Group (`/OCProperties`) layers */
748
+ layers?: IPdfLayer[];
749
+ /** Optional embedded file attachments (`/Names /EmbeddedFiles`) */
750
+ attachments?: IPdfAttachment[];
751
+ /** Optional document security & permission restrictions */
752
+ securityPermissions?: IPdfSecurityPermissions;
753
+ /** Optional deterministic SHA-256 digital signature envelope */
754
+ signatureEnvelope?: IPdfSignatureEnvelope;
755
+ /** Emit PDF/A-1b XMP Dublin Core metadata & `/OutputIntents` */
756
+ pdfACompliant?: boolean;
757
+ /** Emit PDF/UA `/MarkInfo << /Marked true >>` & `/StructTreeRoot` tagged accessibility tree */
758
+ accessibilityTagged?: boolean;
759
+ resourceBindings?: Record<string, IPdfResourceBinding>;
760
+ metadata?: IPdfUnitMetadata;
761
+ }
762
+ type IPdfDocumentData = IPdfUnitData;
763
+ interface IPdfVersionSnapshot {
764
+ id: string;
765
+ unitId: string;
766
+ label: string;
767
+ createdAt: string;
768
+ summary?: string;
769
+ snapshot: IPdfUnitData;
770
+ }
771
+
772
+ interface IPdfmeSchemaItem {
773
+ name: string;
774
+ type: string;
775
+ position: {
776
+ x: number;
777
+ y: number;
778
+ };
779
+ width: number;
780
+ height: number;
781
+ rotate?: number;
782
+ opacity?: number;
783
+ content?: string;
784
+ fontSize?: number;
785
+ fontColor?: string;
786
+ backgroundColor?: string;
787
+ alignment?: 'left' | 'center' | 'right' | 'justify';
788
+ verticalAlignment?: 'top' | 'middle' | 'bottom';
789
+ lineHeight?: number;
790
+ head?: string[];
791
+ headWidthPercentages?: number[];
792
+ [key: string]: unknown;
793
+ }
794
+ interface IPdfmeBlankPdf {
795
+ width: number;
796
+ height: number;
797
+ padding: [number, number, number, number];
798
+ staticSchema?: IPdfmeSchemaItem[];
799
+ }
800
+ interface IPdfmeTemplate {
801
+ basePdf: string | IPdfmeBlankPdf;
802
+ schemas: IPdfmeSchemaItem[][];
803
+ }
804
+ /**
805
+ * Optional adapter: converts Univer `IPdfUnitData` (pt, id-dictionary) -> `pdfme` Template (mm, 2D array).
806
+ */
807
+ declare function toPdfmeTemplate(unitData: IPdfUnitData): IPdfmeTemplate;
808
+ /**
809
+ * Optional adapter: imports a `pdfme` Template (mm, 2D array) into Univer `IPdfUnitData` (pt, id-dictionary).
810
+ */
811
+ declare function fromPdfmeTemplate(template: IPdfmeTemplate, options?: {
812
+ id?: string;
813
+ name?: string;
814
+ }): IPdfUnitData;
815
+ declare const exportToPdfmeTemplate: typeof toPdfmeTemplate;
816
+ declare const importFromPdfmeTemplate: typeof fromPdfmeTemplate;
817
+
818
+ type PdfPaperPresetName = 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | 'LETTER' | 'LEGAL' | 'TABLOID' | 'LEDGER' | 'EXECUTIVE' | 'INVOICE_240_140' | 'WAYBILL_100_180';
819
+ declare const PAGE_SIZE_PRESETS_MM: Record<PdfPaperPresetName, {
820
+ width: number;
821
+ height: number;
822
+ }>;
823
+ interface IDetectedPaperPreset {
824
+ preset: PdfPaperPresetName;
825
+ orientation: 'portrait' | 'landscape';
826
+ widthMm: number;
827
+ heightMm: number;
828
+ }
829
+ /**
830
+ * Detects a standard ISO/ANSI/Invoice paper preset from millimeter dimensions `(widthMm, heightMm)`
831
+ * or `{ width, height }` within `toleranceMm` (default `1.5mm`).
832
+ */
833
+ declare function detectPaperSizePreset(widthOrSize: number | {
834
+ width: number;
835
+ height: number;
836
+ }, heightMm?: number, toleranceMm?: number): IDetectedPaperPreset | null;
837
+ /**
838
+ * Resolves a paper preset name (e.g. `'A4'`, `'Letter'`, `'A4_LANDSCAPE'`) or explicit millimeter/point size
839
+ * into `{ width, height, preset, orientation }` in millimeters.
840
+ */
841
+ declare function resolvePageSizeMm(input: PdfPaperPresetName | string | {
842
+ width: number;
843
+ height: number;
844
+ } | {
845
+ widthPt: number;
846
+ heightPt: number;
847
+ }, orientation?: 'portrait' | 'landscape'): {
848
+ width: number;
849
+ height: number;
850
+ widthPt: number;
851
+ heightPt: number;
852
+ preset: PdfPaperPresetName | null;
853
+ orientation: 'portrait' | 'landscape';
854
+ };
855
+ type PdfCjkScriptBlock = 'han' | 'hiragana' | 'katakana' | 'hangul' | 'bopomofo' | 'cjkPunctuation' | 'fullwidth';
856
+ interface ICjkDetectionSummary {
857
+ hasCJK: boolean;
858
+ totalCJKChars: number;
859
+ uniqueChars: string[];
860
+ scripts: PdfCjkScriptBlock[];
861
+ countsByScript: Record<PdfCjkScriptBlock, number>;
862
+ sampleChars: string[];
863
+ }
864
+ /**
865
+ * Detects CJK characters across all 7 Unicode CJK blocks
866
+ * (`han | hiragana | katakana | hangul | bopomofo | cjkPunctuation | fullwidth`).
867
+ */
868
+ declare function detectCJKCharacters(text: string): ICjkDetectionSummary;
869
+ interface ITemplateCjkReport {
870
+ hasCJK: boolean;
871
+ scripts: PdfCjkScriptBlock[];
872
+ uniqueChars: string[];
873
+ affectedFields: Array<{
874
+ pageIndex: number;
875
+ fieldName: string;
876
+ scripts: PdfCjkScriptBlock[];
877
+ sampleChars: string[];
878
+ }>;
879
+ }
880
+ /**
881
+ * Scans an `IPdfUnitData` unit or `IPdfmeTemplate` for CJK characters across all elements,
882
+ * table headers/cells, list items, static schemas, headers/footers, and watermarks.
883
+ */
884
+ declare function detectCJKInPdfTemplate(unitOrTemplate: IPdfUnitData | IPdfmeTemplate): ITemplateCjkReport;
885
+ interface IInputsCjkReport {
886
+ hasCJK: boolean;
887
+ scripts: PdfCjkScriptBlock[];
888
+ uniqueChars: string[];
889
+ affectedKeys: Array<{
890
+ recordIndex: number;
891
+ key: string;
892
+ scripts: PdfCjkScriptBlock[];
893
+ sampleChars: string[];
894
+ }>;
895
+ }
896
+ /**
897
+ * Scans runtime input records (`Record<string, unknown>` or `Array<Record<string, unknown>>`) for CJK characters.
898
+ */
899
+ declare function detectCJKInPdfInputs(inputs: Record<string, unknown> | Array<Record<string, unknown>>): IInputsCjkReport;
900
+ interface IPdfSchemaDiagnosticIssue {
901
+ severity: 'error' | 'warning';
902
+ code: 'INVALID_TEMPLATE_ROOT' | 'MISSING_BASE_PDF' | 'INVALID_PAGE_SIZE' | 'UNKNOWN_ELEMENT_TYPE' | 'DUPLICATE_FIELD_NAME' | 'MISSING_FIELD_NAME' | 'INVALID_DIMENSIONS' | 'NEGATIVE_POSITION' | 'OUT_OF_BOUNDS';
903
+ message: string;
904
+ pageIndex?: number;
905
+ fieldName?: string;
906
+ suggestion?: string;
907
+ }
908
+ interface IValidatePdfTemplateSchemaOptions {
909
+ strict?: boolean;
910
+ customElementTypes?: string[];
911
+ boundsToleranceMm?: number;
912
+ }
913
+ interface IPdfTemplateSchemaValidationResult {
914
+ valid: boolean;
915
+ errors: IPdfSchemaDiagnosticIssue[];
916
+ warnings: IPdfSchemaDiagnosticIssue[];
917
+ issues: IPdfSchemaDiagnosticIssue[];
918
+ pageCount: number;
919
+ fieldCount: number;
920
+ }
921
+ /**
922
+ * Validates a Univer `IPdfUnitData` snapshot or `pdfme` `IPdfmeTemplate` schema for structural soundness,
923
+ * unknown element types (with Levenshtein closest-type suggestion), duplicate field names, negative coordinates,
924
+ * non-positive dimensions, and out-of-bounds placement.
925
+ */
926
+ declare function validatePdfTemplateSchema(unitOrTemplate: unknown, options?: IValidatePdfTemplateSchemaOptions): IPdfTemplateSchemaValidationResult;
927
+ interface IPdfFieldContractHint {
928
+ fieldName: string;
929
+ pageIndex: number;
930
+ elementType: string;
931
+ expectedInputType: 'string' | 'multiVariableJson' | 'string[][]' | 'boolean' | 'option' | 'date' | 'time' | 'dateTime' | 'barcode';
932
+ required: boolean;
933
+ readOnly?: boolean;
934
+ variables?: string[];
935
+ options?: string[];
936
+ radioGroupKey?: string;
937
+ columnHeaders?: string[];
938
+ dateFormat?: string;
939
+ barcodeFormat?: string;
940
+ exampleValue: unknown;
941
+ }
942
+ /**
943
+ * Inspects a Univer `IPdfUnitData` unit or `pdfme` `IPdfmeTemplate` and extracts typed runtime input
944
+ * contract hints for every dynamic field.
945
+ */
946
+ declare function collectPdfInputContractHints(unitOrTemplate: IPdfUnitData | IPdfmeTemplate): IPdfFieldContractHint[];
947
+ interface IPdfInputContractViolation {
948
+ recordIndex: number;
949
+ fieldName: string;
950
+ code: 'REQUIRED_FIELD_MISSING' | 'INVALID_MULTI_VARIABLE_JSON' | 'MISSING_MULTI_VARIABLE_KEY' | 'INVALID_TABLE_INPUT' | 'TABLE_COLUMN_COUNT_MISMATCH' | 'RADIO_GROUP_MUTUAL_EXCLUSION' | 'INVALID_OPTION_VALUE' | 'INVALID_CALENDAR_DATE' | 'INVALID_TIME_VALUE' | 'INVALID_BARCODE_PAYLOAD' | 'INVALID_BARCODE_CHECK_DIGIT';
951
+ message: string;
952
+ }
953
+ interface IPdfInputContractValidationResult {
954
+ valid: boolean;
955
+ violations: IPdfInputContractViolation[];
956
+ hints: IPdfFieldContractHint[];
957
+ }
958
+ /**
959
+ * Validates runtime input records against a template's field contracts:
960
+ * - `multiVariableText` JSON/object structure & required variable keys
961
+ * - `table` `string[][]` 2D string matrix & column count alignment
962
+ * - `radioGroup` mutual exclusion (both `group`-linked boolean radios and option-list radios)
963
+ * - `date / time / dateTime` strict Gregorian calendar validity (rejecting e.g. `2026-02-30`)
964
+ * - Barcode symbology character sets & GS1/UPC Modulo-10 check digits
965
+ */
966
+ declare function validatePdfInputContract(unitOrTemplate: IPdfUnitData | IPdfmeTemplate, inputs: Record<string, unknown> | Array<Record<string, unknown>>): IPdfInputContractValidationResult;
967
+ /**
968
+ * SSRF-safe URL validator for remote font downloads.
969
+ * Rejects non-HTTP(S) schemes, embedded credentials, `localhost` / `.local` / `.internal` hostnames,
970
+ * IPv4 loopback/private/link-local/metadata ranges, integer/hex IP encodings, and IPv6 loopback/unique-local/link-local addresses.
971
+ */
972
+ declare function isFontUrlSafeToFetch(rawUrl: string): boolean;
973
+ interface IPdfFontDoctorInputEntry {
974
+ data: Uint8Array | ArrayBuffer | string;
975
+ fallback?: boolean;
976
+ }
977
+ interface IDiagnosePdfFontsOptions {
978
+ fonts?: Record<string, IPdfFontDoctorInputEntry>;
979
+ inputs?: Record<string, unknown> | Array<Record<string, unknown>>;
980
+ }
981
+ interface IPdfFontDiagnosticIssue {
982
+ severity: 'error' | 'warning';
983
+ code: 'MISSING_FONT' | 'CJK_WITHOUT_EMBEDDED_FONT' | 'MULTIPLE_FALLBACK_FONTS' | 'NO_FALLBACK_FONT' | 'GOOGLE_FONTS_CSS_URL' | 'UNSAFE_FONT_URL' | 'OTF_CFF_FONT_DETECTED' | 'TTC_COLLECTION_FONT_DETECTED' | 'WOFF_FONT_DETECTED' | 'CORRUPT_FONT_BINARY' | 'MISSING_GLYPH_COVERAGE';
984
+ fontName?: string;
985
+ message: string;
986
+ missingChars?: string[];
987
+ }
988
+ interface IPdfFontDiagnosisReport {
989
+ healthy: boolean;
990
+ referencedFonts: string[];
991
+ registeredFonts: string[];
992
+ hasCJKContent: boolean;
993
+ issues: IPdfFontDiagnosticIssue[];
994
+ errors: IPdfFontDiagnosticIssue[];
995
+ warnings: IPdfFontDiagnosticIssue[];
996
+ }
997
+ /**
998
+ * Diagnoses font configuration, CJK readiness, Google Fonts CSS URLs, SSRF URL safety,
999
+ * `.otf` / `.ttc` / `.woff` binary formats, and TrueType `cmap` glyph coverage against template + input text.
1000
+ */
1001
+ declare function diagnosePdfFonts(unitOrTemplate: IPdfUnitData | IPdfmeTemplate, options?: IDiagnosePdfFontsOptions): IPdfFontDiagnosisReport;
1002
+
1003
+ type PdfCjkTextMode = 'raster-hd' | 'cid-vector' | 'subset-ttf';
1004
+ interface IDiagnosticGridOverlayOptions {
1005
+ /** Minor grid step in millimeters (default `5`) */
1006
+ minorStepMm?: number;
1007
+ /** Major grid & ruler label step in millimeters (default `10`) */
1008
+ majorStepMm?: number;
1009
+ /** Render top & left millimeter tick labels (default `true`) */
1010
+ showRulerLabels?: boolean;
1011
+ /** Draw dashed bounding boxes around every template element (default `true`) */
1012
+ showElementBounds?: boolean;
1013
+ /** Draw `fieldName (type)` labels on element bounding boxes (default `true`) */
1014
+ showElementLabels?: boolean;
1015
+ /** Opacity of the diagnostic grid lines (`0..1`, default `0.35`) */
1016
+ gridOpacity?: number;
1017
+ }
1018
+ interface IPdfExportOptions {
1019
+ /**
1020
+ * When `true`, generates interactive standard PDF `AcroForm` widgets (`PDFTextField`,
1021
+ * `PDFCheckBox`, `PDFRadioGroup`, `PDFDropdown`) via `pdfDoc.getForm()`.
1022
+ * Defaults to `false` (print-flattened PDF).
1023
+ */
1024
+ interactiveForm?: boolean;
1025
+ /** Alias for `interactiveForm`: emits standard interactive PDF AcroForm widgets when `true`. */
1026
+ exportAcroForm?: boolean;
1027
+ /**
1028
+ * CJK text rendering strategy:
1029
+ * - `'raster-hd'`: 3x DPI browser canvas PNG (default when no vector mode specified)
1030
+ * - `'cid-vector'`: 0KB embedded PDF `Type0` + `CIDFontType2 /STSong-Light` + `/UniGB-UTF16-H` selectable vector text
1031
+ * - `'subset-ttf'`: pure-TS subset TrueType `FontFile2` + `CIDFontType2` + `ToUnicode` searchable vector text
1032
+ */
1033
+ cjkTextMode?: PdfCjkTextMode;
1034
+ /** Custom TrueType (`.ttf`) font bytes used when `cjkTextMode === 'subset-ttf'` */
1035
+ customFontBytes?: Uint8Array;
1036
+ /** Color space emission mode (`'rgb'` default or print `'cmyk'`) */
1037
+ colorType?: PdfColorSpaceType;
1038
+ /** Overlays a minor/major millimeter diagnostic grid + dashed element bounding boxes & `fieldName (type)` labels */
1039
+ diagnosticGridOverlay?: boolean | IDiagnosticGridOverlayOptions;
1040
+ /** Horizontal needle/thermal printer feed offset compensation in millimeters (shifts output without mutating snapshot) */
1041
+ printerOffsetXMm?: number;
1042
+ /** Vertical needle/thermal printer feed offset compensation in millimeters (shifts output without mutating snapshot) */
1043
+ printerOffsetYMm?: number;
1044
+ /** Emits PDF/A-1b XMP Dublin Core `/Metadata` stream & sRGB `/OutputIntents` */
1045
+ pdfACompliant?: boolean;
1046
+ /** Emits PDF/UA `/MarkInfo << /Marked true >>`, `/StructTreeRoot`, & `/Alt` element tagging */
1047
+ accessibilityTagged?: boolean;
1048
+ /** Compresses uncompressed streams with FlateDecode & prunes unreferenced indirect objects */
1049
+ optimizeSize?: boolean;
1050
+ }
1051
+ declare function resolveTemplateString(raw: string, bindingField?: string, data?: Record<string, unknown>, pageMeta?: {
1052
+ pageNumber: number;
1053
+ totalPages: number;
1054
+ includeSystemDates?: boolean;
1055
+ }): string;
1056
+ interface IPdfVariableValidationResult {
1057
+ valid: boolean;
1058
+ missingVariables: string[];
1059
+ referencedVariables: string[];
1060
+ missingByElement: Array<{
1061
+ pageId: string;
1062
+ elementId: string;
1063
+ elementName?: string;
1064
+ missing: string[];
1065
+ }>;
1066
+ }
1067
+ /**
1068
+ * Validates required template variables across all pages of an `IPdfUnitData` unit against `data`.
1069
+ * Inspects `IPdfTextElement.requiredVariables` as well as elements marked `required: true`.
1070
+ */
1071
+ declare function validatePdfTemplateVariables(unitData: IPdfUnitData, data?: Record<string, unknown>): IPdfVariableValidationResult;
1072
+ declare function renderQrCodeDataUrl(content: string, foregroundColor?: string, backgroundColor?: string): Promise<string>;
1073
+ interface IComputeDynamicFontSizeParams {
1074
+ text: string;
1075
+ widthPt: number;
1076
+ heightPt: number;
1077
+ min: number;
1078
+ max: number;
1079
+ fit?: PdfDynamicFontFitMode;
1080
+ padding?: number;
1081
+ lineHeight?: number;
1082
+ characterSpacing?: number;
1083
+ fontWeight?: 'normal' | 'bold';
1084
+ }
1085
+ /**
1086
+ * Computes bidirectional dynamic font size (`0.25pt` binary precision) within `[min, max]`,
1087
+ * growing toward `max` when text is short or shrinking toward `min` when text is long.
1088
+ * Supports `fit: 'horizontal'` (fitting the widest paragraph onto single lines within `innerWidth`)
1089
+ * and `fit: 'vertical'` (wrapping lines within `innerWidth` and fitting total height within `innerHeight`).
1090
+ */
1091
+ declare function computeDynamicFontSize(params: IComputeDynamicFontSizeParams): number;
1092
+ declare function computeDynamicFontSize(text: string, widthPt: number, heightPt: number, config: IPdfDynamicFontSizeConfig, style?: Pick<IPdfTextStyle, 'padding' | 'lineHeight' | 'characterSpacing' | 'fontWeight'>): number;
1093
+ declare function computeAutoFitFontSize(text: string, widthPt: number, heightPt: number, baseFontSize?: number, minFontSize?: number, padding?: number, lineHeightRatio?: number): number;
1094
+ declare function normalizeBarcodePayloadForFormat(raw: string, format: PdfBarcodeFormat): string;
1095
+ declare function renderBarcodeDataUrl(el: IPdfBarcodeElement, value?: string): string | null;
1096
+ /**
1097
+ * Formats a raw cell value according to an `IPdfTableColumn` specification (`text`, `number`, `currency`, `percent`).
1098
+ */
1099
+ declare function formatPdfTableCell(rawValue: unknown, col: IPdfTableColumn): string;
1100
+ /**
1101
+ * Computes an aggregated summary row (`sum`, `avg`, `count`, `none`) across a set of raw rows.
1102
+ */
1103
+ declare function computePdfTableSummaryRow(rawRows: unknown[][], columns: IPdfTableColumn[], label: string): string[];
1104
+ declare function resolveDynamicTableRawRows(el: IPdfTableElement, data?: Record<string, unknown>): unknown[][];
1105
+ interface IPdfTablePageChunk {
1106
+ chunkIndex: number;
1107
+ totalChunks: number;
1108
+ startRowIndex: number;
1109
+ rows: unknown[][];
1110
+ formattedRows: string[][];
1111
+ subtotalRow?: string[];
1112
+ grandTotalRow?: string[];
1113
+ deferredOrphanHeader?: boolean;
1114
+ }
1115
+ /**
1116
+ * Calculates multi-page dynamic table pagination chunks, reserving exact vertical row budget
1117
+ * for `showPageSubtotal` (on every page) and `showGrandTotal` (on the final page), and protecting
1118
+ * against orphan headers when `avoidOrphanHeader` is active.
1119
+ */
1120
+ declare function paginatePdfTableRows(el: IPdfTableElement, rawRows: unknown[][], pageHeight: number): IPdfTablePageChunk[];
1121
+ /**
1122
+ * Formats a Bates legal stamp string for a 0-based page index (e.g. `YD-DOC-000001`).
1123
+ */
1124
+ declare function formatBatesNumber(batesConfig: IPdfBatesConfig, pageZeroIndex: number): string;
1125
+ /**
1126
+ * Compiles a Univer `IPdfUnitData` snapshot (plus optional dataset values & export options) into standard PDF bytes.
1127
+ */
1128
+ declare function exportPdfBytes(snapshot: IPdfUnitData, runtimeData?: Record<string, unknown>, options?: IPdfExportOptions): Promise<Uint8Array>;
1129
+ /**
1130
+ * Loads an interactive PDF binary (`Uint8Array`) via `PDFDocument.load`, inspects all `AcroForm`
1131
+ * fields (`PDFTextField`, `PDFCheckBox`, `PDFDropdown`, `PDFOptionList`, `PDFRadioGroup`, `/FT /Sig`),
1132
+ * and returns `{ [fieldName]: value }`.
1133
+ */
1134
+ declare function extractAcroFormValuesFromPdfBytes(pdfBytes: Uint8Array): Promise<Record<string, string | boolean>>;
1135
+ /**
1136
+ * Extracts interactive form values from `CHECKBOX`, `RADIO_GROUP`, `SELECT`, and keyed `TEXT` elements
1137
+ * (`@pdfme/ui` `Form.getInputs()` parity).
1138
+ */
1139
+ declare function extractPdfFormValues(snapshot: IPdfUnitData): Record<string, string | boolean>;
1140
+ /**
1141
+ * Fills interactive form values back into an `IPdfUnitData` snapshot (`@pdfme/ui` `Form.setInputs()` parity).
1142
+ */
1143
+ declare function fillPdfFormValues(snapshot: IPdfUnitData, values: Record<string, unknown>): IPdfUnitData;
1144
+ /**
1145
+ * Batch Mail-Merge PDF Engine (`@pdfme/generator` multi-input `generate({ template, inputs: [...] })` parity):
1146
+ * Renders each record in `records` against `snapshot` and merges all pages into a single continuous PDF document.
1147
+ */
1148
+ declare function exportBatchPdfBytes(snapshot: IPdfUnitData, records: Array<Record<string, unknown>>, options?: IPdfExportOptions): Promise<Uint8Array>;
1149
+ /**
1150
+ * Generates a printable `1mm / 5mm / 10mm` millimeter calibration ruler & crosshair test-sheet PDF
1151
+ * anchored from top-left `(0, 0)` so operators can test-print onto physical pre-printed forms
1152
+ * and read exact `printerOffsetXMm` / `printerOffsetYMm` hardware feed offsets.
1153
+ */
1154
+ declare function exportCalibrationGridPdfBytes(pageSize?: IPdfPageSize): Promise<Uint8Array>;
1155
+ /**
1156
+ * Overlays a millimeter diagnostic coordinate grid (minor + major lines, top/left millimeter ruler labels)
1157
+ * AND dashed element bounding boxes + `fieldName (type)` badges onto existing PDF bytes.
1158
+ */
1159
+ declare function overlayDiagnosticGridOnPdfBytes(pdfBytes: Uint8Array, snapshot?: IPdfUnitData | IPdfmeTemplate | null, options?: IDiagnosticGridOverlayOptions): Promise<Uint8Array>;
1160
+ interface IPdfExportCapabilitiesReport {
1161
+ pageCount: number;
1162
+ elementCount: number;
1163
+ hasBasePdf: boolean;
1164
+ snapshotByteSize: number;
1165
+ warnings: string[];
1166
+ }
1167
+ declare function inspectPdfExportCapabilities(snapshot: Partial<IPdfUnitData> | null | undefined): IPdfExportCapabilitiesReport;
1168
+
1169
+ declare const PDF_JSX_ELEMENT_SYMBOL: unique symbol;
1170
+ declare const PDF_JSX_FRAGMENT_SYMBOL: unique symbol;
1171
+ type PdfJsxIntrinsicKind = 'Fragment' | 'Document' | 'Page' | 'Header' | 'Footer' | 'Static' | 'Absolute' | 'Stack' | 'Row' | 'Box' | 'Spacer' | 'PageBreak' | 'Text' | 'MultiVariableText' | 'Image' | 'Svg' | 'Rectangle' | 'Ellipse' | 'Line' | 'List' | 'Table' | 'Barcode' | 'QrCode';
1172
+ type PdfJsxPaddingSpec = number | [number, number] | [number, number, number, number] | {
1173
+ top?: number;
1174
+ right?: number;
1175
+ bottom?: number;
1176
+ left?: number;
1177
+ };
1178
+ type PdfJsxChild = IPdfJsxNode | string | number | boolean | null | undefined | PdfJsxChild[];
1179
+ interface IPdfJsxNode<P = Record<string, any>> {
1180
+ $$typeof: typeof PDF_JSX_ELEMENT_SYMBOL;
1181
+ kind: PdfJsxIntrinsicKind;
1182
+ props: P;
1183
+ key?: string | number | null;
1184
+ }
1185
+ type PdfJsxComponent<P = any> = (props: P) => IPdfJsxNode | null;
1186
+ interface IJsxContainerStyleProps {
1187
+ /** Width in millimeters (optional; defaults to available parent width or flex share) */
1188
+ width?: number;
1189
+ /** Fixed or minimum height in millimeters */
1190
+ height?: number;
1191
+ minHeight?: number;
1192
+ /** Flex grow factor inside `<Row>` */
1193
+ flex?: number;
1194
+ /** Padding in millimeters */
1195
+ padding?: PdfJsxPaddingSpec;
1196
+ backgroundColor?: string;
1197
+ borderColor?: string;
1198
+ /** Border stroke width in points (default `0` unless `borderColor` is set, then `1`) */
1199
+ borderWidth?: number;
1200
+ borderDashArray?: number[];
1201
+ opacity?: number;
1202
+ name?: string;
1203
+ children?: PdfJsxChild;
1204
+ }
1205
+ interface IJsxDocumentProps {
1206
+ name?: string;
1207
+ title?: string;
1208
+ colorType?: PdfColorSpaceType;
1209
+ sampleData?: Record<string, unknown>;
1210
+ children?: PdfJsxChild;
1211
+ }
1212
+ interface IJsxPageProps {
1213
+ size?: PdfPaperPresetName | string | {
1214
+ width: number;
1215
+ height: number;
1216
+ };
1217
+ orientation?: 'portrait' | 'landscape';
1218
+ /** Page margins in millimeters (default `[15, 15, 15, 15]`) */
1219
+ padding?: PdfJsxPaddingSpec;
1220
+ margins?: PdfJsxPaddingSpec;
1221
+ backgroundColor?: string;
1222
+ title?: string;
1223
+ children?: PdfJsxChild;
1224
+ }
1225
+ interface IJsxHeaderFooterProps extends IJsxContainerStyleProps {
1226
+ /** Vertical offset in millimeters from top (for Header) or bottom (for Footer) */
1227
+ offsetMm?: number;
1228
+ }
1229
+ interface IJsxStaticProps {
1230
+ x?: number;
1231
+ y?: number;
1232
+ width?: number;
1233
+ height?: number;
1234
+ children?: PdfJsxChild;
1235
+ }
1236
+ interface IJsxAbsoluteProps extends IJsxContainerStyleProps {
1237
+ /** X position in millimeters from page left */
1238
+ x: number;
1239
+ /** Y position in millimeters from page top */
1240
+ y: number;
1241
+ rotate?: number;
1242
+ flipX?: boolean;
1243
+ flipY?: boolean;
1244
+ }
1245
+ interface IJsxStackProps extends IJsxContainerStyleProps {
1246
+ /** Vertical gap between children in millimeters (default `0`) */
1247
+ gap?: number;
1248
+ alignItems?: 'start' | 'center' | 'end' | 'stretch';
1249
+ }
1250
+ interface IJsxRowProps extends IJsxContainerStyleProps {
1251
+ /** Horizontal gap between children in millimeters (default `0`) */
1252
+ gap?: number;
1253
+ alignItems?: 'start' | 'center' | 'end' | 'stretch';
1254
+ justifyContent?: 'start' | 'center' | 'end' | 'space-between';
1255
+ }
1256
+ interface IJsxBoxProps extends IJsxContainerStyleProps {
1257
+ gap?: number;
1258
+ }
1259
+ interface IJsxSpacerProps {
1260
+ /** Size in millimeters (vertical in `<Stack>`, horizontal in `<Row>`) */
1261
+ size?: number;
1262
+ width?: number;
1263
+ height?: number;
1264
+ flex?: number;
1265
+ }
1266
+ interface IJsxPageBreakProps {
1267
+ key?: string | number;
1268
+ }
1269
+ interface IJsxTextProps {
1270
+ name?: string;
1271
+ field?: string;
1272
+ content?: string;
1273
+ width?: number;
1274
+ height?: number;
1275
+ flex?: number;
1276
+ fontSize?: number;
1277
+ fontFamily?: string;
1278
+ fontWeight?: 'normal' | 'bold';
1279
+ bold?: boolean;
1280
+ italic?: boolean;
1281
+ underline?: boolean;
1282
+ color?: string;
1283
+ backgroundColor?: string;
1284
+ borderColor?: string;
1285
+ borderWidth?: number;
1286
+ padding?: number;
1287
+ lineHeight?: number;
1288
+ align?: 'left' | 'center' | 'right';
1289
+ verticalAlign?: 'top' | 'middle' | 'bottom';
1290
+ textFormat?: PdfTextFormatMode;
1291
+ overflow?: 'clip' | 'shrink' | 'expand';
1292
+ rotate?: number;
1293
+ flipX?: boolean;
1294
+ flipY?: boolean;
1295
+ required?: boolean;
1296
+ linkUrl?: string;
1297
+ children?: PdfJsxChild;
1298
+ }
1299
+ interface IJsxMultiVariableTextProps extends IJsxTextProps {
1300
+ variables?: string[];
1301
+ }
1302
+ interface IJsxImageProps {
1303
+ name?: string;
1304
+ field?: string;
1305
+ src?: string;
1306
+ width?: number;
1307
+ height?: number;
1308
+ flex?: number;
1309
+ fit?: 'contain' | 'cover' | 'fill';
1310
+ objectPosition?: string;
1311
+ alt?: string;
1312
+ opacity?: number;
1313
+ rotate?: number;
1314
+ flipX?: boolean;
1315
+ flipY?: boolean;
1316
+ }
1317
+ interface IJsxSvgProps {
1318
+ name?: string;
1319
+ field?: string;
1320
+ svg?: string;
1321
+ content?: string;
1322
+ width?: number;
1323
+ height?: number;
1324
+ flex?: number;
1325
+ opacity?: number;
1326
+ rotate?: number;
1327
+ flipX?: boolean;
1328
+ flipY?: boolean;
1329
+ children?: PdfJsxChild;
1330
+ }
1331
+ interface IJsxShapeProps {
1332
+ name?: string;
1333
+ width?: number;
1334
+ height?: number;
1335
+ flex?: number;
1336
+ fill?: string;
1337
+ fillColor?: string;
1338
+ stroke?: string;
1339
+ strokeColor?: string;
1340
+ strokeWidth?: number;
1341
+ dashArray?: number[];
1342
+ opacity?: number;
1343
+ rotate?: number;
1344
+ flipX?: boolean;
1345
+ flipY?: boolean;
1346
+ }
1347
+ interface IJsxLineProps {
1348
+ name?: string;
1349
+ width?: number;
1350
+ height?: number;
1351
+ flex?: number;
1352
+ color?: string;
1353
+ strokeColor?: string;
1354
+ thickness?: number;
1355
+ strokeWidth?: number;
1356
+ dashArray?: number[];
1357
+ startArrow?: boolean;
1358
+ endArrow?: boolean;
1359
+ opacity?: number;
1360
+ rotate?: number;
1361
+ }
1362
+ interface IJsxListProps {
1363
+ name?: string;
1364
+ items?: string[];
1365
+ ordered?: boolean;
1366
+ listType?: 'bullet' | 'ordered' | 'check';
1367
+ width?: number;
1368
+ height?: number;
1369
+ flex?: number;
1370
+ fontSize?: number;
1371
+ lineHeight?: number;
1372
+ color?: string;
1373
+ overflow?: 'clip' | 'expand';
1374
+ children?: PdfJsxChild;
1375
+ }
1376
+ interface IJsxTableColumnSpec {
1377
+ header: string;
1378
+ field?: string;
1379
+ widthRatio?: number;
1380
+ align?: 'left' | 'center' | 'right';
1381
+ format?: 'text' | 'number' | 'currency' | 'percent';
1382
+ currencySymbol?: string;
1383
+ decimals?: number;
1384
+ summaryType?: 'none' | 'sum' | 'avg' | 'count';
1385
+ }
1386
+ interface IJsxTableProps {
1387
+ name?: string;
1388
+ field?: string;
1389
+ columns?: Array<string | IJsxTableColumnSpec>;
1390
+ rows?: unknown[][];
1391
+ width?: number;
1392
+ height?: number;
1393
+ flex?: number;
1394
+ headerHeight?: number;
1395
+ rowHeight?: number;
1396
+ borderColor?: string;
1397
+ zebraStripeColor?: string;
1398
+ showPageSubtotal?: boolean;
1399
+ showGrandTotal?: boolean;
1400
+ avoidOrphanHeader?: boolean;
1401
+ }
1402
+ interface IJsxBarcodeProps {
1403
+ name?: string;
1404
+ field?: string;
1405
+ value?: string;
1406
+ content?: string;
1407
+ format?: PdfBarcodeFormat;
1408
+ width?: number;
1409
+ height?: number;
1410
+ flex?: number;
1411
+ displayValue?: boolean;
1412
+ foregroundColor?: string;
1413
+ backgroundColor?: string;
1414
+ rotate?: number;
1415
+ }
1416
+ interface IJsxQrCodeProps {
1417
+ name?: string;
1418
+ field?: string;
1419
+ value?: string;
1420
+ content?: string;
1421
+ size?: number;
1422
+ width?: number;
1423
+ height?: number;
1424
+ flex?: number;
1425
+ foregroundColor?: string;
1426
+ backgroundColor?: string;
1427
+ rotate?: number;
1428
+ }
1429
+ interface IRenderJsxOptions {
1430
+ name?: string;
1431
+ defaultPageSize?: PdfPaperPresetName | string | {
1432
+ width: number;
1433
+ height: number;
1434
+ };
1435
+ defaultPaddingMm?: PdfJsxPaddingSpec;
1436
+ }
1437
+ interface IExportJsxToPdfOptions extends IRenderJsxOptions, IPdfExportOptions {
1438
+ }
1439
+
1440
+ declare function isPdfJsxNode(value: unknown): value is IPdfJsxNode;
1441
+ declare function createPdfJsxNode<P extends Record<string, any>>(kind: PdfJsxIntrinsicKind, props?: P | null, key?: string | number | null): IPdfJsxNode<P>;
1442
+ /**
1443
+ * Zero-React JSX Fragment component (`<>...</>`).
1444
+ */
1445
+ declare function Fragment(props: {
1446
+ children?: PdfJsxChild;
1447
+ }): IPdfJsxNode<{
1448
+ children?: PdfJsxChild;
1449
+ }>;
1450
+ /**
1451
+ * Evaluates a JSX tag (`string`, `Fragment`, or function component) into a normalized `IPdfJsxNode`.
1452
+ */
1453
+ declare function evaluatePdfJsxElement(type: PdfJsxIntrinsicKind | typeof PDF_JSX_FRAGMENT_SYMBOL | PdfJsxComponent | string, rawProps: Record<string, any> | null | undefined, key?: string | number | null): IPdfJsxNode;
1454
+ /**
1455
+ * Flattens nested `Fragment`s and arrays of `PdfJsxChild` into concrete `IPdfJsxNode` children
1456
+ * (converting stray primitive strings/numbers into `<Text>` nodes when inside layout containers).
1457
+ */
1458
+ declare function flattenJsxChildrenToNodes(children: PdfJsxChild): IPdfJsxNode[];
1459
+ /**
1460
+ * Extracts concatenated plain string text from JSX `children` (for `<Text>{'Invoice #'}{101}</Text>`).
1461
+ */
1462
+ declare function extractJsxTextContent(children: PdfJsxChild, fallback?: string): string;
1463
+ /**
1464
+ * Normalizes a `PdfJsxPaddingSpec` into `[topMm, rightMm, bottomMm, leftMm]`.
1465
+ */
1466
+ declare function resolvePaddingMm(spec: PdfJsxPaddingSpec | undefined, defaultAll?: number): [number, number, number, number];
1467
+
1468
+ declare function jsx(type: PdfJsxIntrinsicKind | typeof PDF_JSX_FRAGMENT_SYMBOL | PdfJsxComponent | string, props: Record<string, any> | null, key?: string | number): IPdfJsxNode;
1469
+ declare function jsxs(type: PdfJsxIntrinsicKind | typeof PDF_JSX_FRAGMENT_SYMBOL | PdfJsxComponent | string, props: Record<string, any> | null, key?: string | number): IPdfJsxNode;
1470
+ declare function jsxDEV(type: PdfJsxIntrinsicKind | typeof PDF_JSX_FRAGMENT_SYMBOL | PdfJsxComponent | string, props: Record<string, any> | null, key?: string | number): IPdfJsxNode;
1471
+ declare namespace JSX {
1472
+ type Element = IPdfJsxNode;
1473
+ interface ElementChildrenAttribute {
1474
+ children: {};
1475
+ }
1476
+ interface IntrinsicAttributes {
1477
+ key?: string | number | null;
1478
+ }
1479
+ interface IntrinsicElements {
1480
+ [elemName: string]: Record<string, any>;
1481
+ }
1482
+ }
1483
+
1484
+ export { type IJsxMultiVariableTextProps as $, type IPdfExportOptions as A, PDF_PAGE_PRESETS as B, type PdfBatesPosition as C, type IPdfSignerInfo as D, type IPdfjsAssetsConfig as E, type PdfDisplayUnit as F, type PdfInteractionMode as G, type IPdfVersionSnapshot as H, type IPdfUnitData as I, Fragment as J, type ICjkDetectionSummary as K, type IComputeDynamicFontSizeParams as L, type IDetectedPaperPreset as M, type IDiagnosePdfFontsOptions as N, type IDiagnosticGridOverlayOptions as O, PdfElementType as P, type IExportJsxToPdfOptions as Q, type IInputsCjkReport as R, type IJsxAbsoluteProps as S, type IJsxBarcodeProps as T, type IJsxBoxProps as U, type IJsxContainerStyleProps as V, type IJsxDocumentProps as W, type IJsxHeaderFooterProps as X, type IJsxImageProps as Y, type IJsxLineProps as Z, type IJsxListProps as _, type IPdfDocument as a, type IPdfmeTemplate as a$, type IJsxPageBreakProps as a0, type IJsxPageProps as a1, type IJsxQrCodeProps as a2, type IJsxRowProps as a3, type IJsxShapeProps as a4, type IJsxSpacerProps as a5, type IJsxStackProps as a6, type IJsxStaticProps as a7, type IJsxSvgProps as a8, type IJsxTableColumnSpec as a9, type IPdfInputContractViolation as aA, type IPdfJsxNode as aB, type IPdfLineElement as aC, type IPdfPageElementBase as aD, type IPdfParagraphBlock as aE, type IPdfPolygonElement as aF, type IPdfPolygonPoint as aG, type IPdfQrCodeElement as aH, type IPdfRadioGroupElement as aI, type IPdfRedactionElement as aJ, type IPdfSchemaDiagnosticIssue as aK, type IPdfSelectElement as aL, type IPdfShapeElement as aM, type IPdfSignatureElement as aN, type IPdfStampElement as aO, type IPdfSvgElement as aP, type IPdfTableBorderWidths as aQ, type IPdfTableCellStyle as aR, type IPdfTableColumn as aS, type IPdfTableElement as aT, type IPdfTableMerge as aU, type IPdfTablePageChunk as aV, type IPdfTableThemePreset as aW, type IPdfTemplateSchemaValidationResult as aX, type IPdfVariableValidationResult as aY, type IPdfmeBlankPdf as aZ, type IPdfmeSchemaItem as a_, type IJsxTableProps as aa, type IJsxTextProps as ab, type IPdfAnnotationElement as ac, type IPdfAnnotationReply as ad, type IPdfBarcodeElement as ae, type IPdfCheckboxElement as af, type IPdfDatasetField as ag, type IPdfDatasetSchema as ah, type IPdfDateTimeElement as ai, type IPdfDocumentMetadata as aj, type IPdfDurableEditState as ak, type IPdfDynamicFontSizeConfig as al, type IPdfElement as am, type IPdfElementBase as an, type IPdfElementTransform as ao, type IPdfEllipseElement as ap, type IPdfExportCapabilitiesReport as aq, type IPdfFieldContractHint as ar, type IPdfFontDiagnosisReport as as, type IPdfFontDiagnosticIssue as at, type IPdfFontDoctorInputEntry as au, type IPdfImageCrop as av, type IPdfImageElement as aw, type IPdfInkElement as ax, type IPdfInkPoint as ay, type IPdfInputContractValidationResult as az, type IPdfPage as b, overlayDiagnosticGridOnPdfBytes as b$, type IRenderJsxOptions as b0, type ITemplateCjkReport as b1, type IValidatePdfTemplateSchemaOptions as b2, JSX as b3, PAGE_SIZE_PRESETS_MM as b4, PDF_JSX_ELEMENT_SYMBOL as b5, PDF_JSX_FRAGMENT_SYMBOL as b6, PDF_TABLE_THEME_PRESETS as b7, PT_PER_MM as b8, type PdfAnnotationStatus as b9, detectCJKInPdfInputs as bA, detectCJKInPdfTemplate as bB, detectPaperSizePreset as bC, diagnosePdfFonts as bD, evaluatePdfJsxElement as bE, exportBatchPdfBytes as bF, exportCalibrationGridPdfBytes as bG, exportPdfBytes as bH, exportToPdfmeTemplate as bI, extractAcroFormValuesFromPdfBytes as bJ, extractJsxTextContent as bK, extractPdfFormValues as bL, fillPdfFormValues as bM, flattenJsxChildrenToNodes as bN, formatBatesNumber as bO, formatPdfTableCell as bP, fromPdfmeTemplate as bQ, importFromPdfmeTemplate as bR, inspectPdfExportCapabilities as bS, isFontUrlSafeToFetch as bT, isPdfJsxNode as bU, jsx as bV, jsxDEV as bW, jsxs as bX, mmToPt as bY, normalizeBarcodePayloadForFormat as bZ, normalizeImageCrop as b_, PdfAnnotationType as ba, type PdfBarcodeFormat as bb, type PdfCjkScriptBlock as bc, type PdfCjkTextMode as bd, type PdfDynamicFontFitMode as be, PdfImageSourceType as bf, type PdfJsxChild as bg, type PdfJsxComponent as bh, type PdfJsxIntrinsicKind as bi, type PdfJsxPaddingSpec as bj, PdfListKind as bk, PdfListPresetId as bl, type PdfPaperPresetName as bm, PdfTableBorderStyle as bn, PdfTableCellVerticalAlign as bo, PdfTextAnchor as bp, type PdfTextFormatMode as bq, type PdfTextOverflowMode as br, UNIVER_PDF_SCHEMA as bs, UNIVER_PDF_SCHEMA_VERSION as bt, collectPdfInputContractHints as bu, computeAutoFitFontSize as bv, computeDynamicFontSize as bw, computePdfTableSummaryRow as bx, createPdfJsxNode as by, detectCJKCharacters as bz, type IPdfPageSize as c, paginatePdfTableRows as c0, ptToMm as c1, renderBarcodeDataUrl as c2, renderQrCodeDataUrl as c3, resolveDynamicTableRawRows as c4, resolvePaddingMm as c5, resolvePageSizeMm as c6, resolvePolygonNormalizedPoints as c7, resolveTemplateString as c8, toPdfmeTemplate as c9, validatePdfInputContract as ca, validatePdfTemplateSchema as cb, validatePdfTemplateVariables as cc, type IPdfPageElement as d, type IPdfLayer as e, type IPdfSourceDocumentRef as f, type IPdfResourceBinding as g, type IPdfUnitMetadata as h, type IPdfAttachment as i, type IPdfSecurityPermissions as j, type IPdfSignatureEnvelope as k, type IPdfTextStyle as l, type PdfPageRotation as m, type IPdfBatesConfig as n, type IPdfBookmarkItem as o, type IPdfHeaderFooterConfig as p, type IPdfNativeTextSpan as q, type IPdfCropBox as r, type IPdfWatermarkConfig as s, type IPdfDocumentData as t, type IPdfTextElement as u, type PdfDateTimeKind as v, type IPdfCircleMarkElement as w, type IPdfListElement as x, type IPdfRichTextSpan as y, type PdfColorSpaceType as z };