@yudaocode/univer-pdfs 1.6.217 → 1.6.219
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/README.md +8 -8
- package/lib/cjs/facade/index.js +2 -1
- package/lib/cjs/facade/index.js.map +1 -1
- package/lib/cjs/index.js +4071 -857
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/jsx/index.js +1688 -418
- package/lib/cjs/jsx/index.js.map +1 -1
- package/lib/es/{chunk-EMSHTYYU.js → chunk-PQUNQAVL.js} +2072 -289
- package/lib/es/chunk-PQUNQAVL.js.map +1 -0
- package/lib/es/facade/index.js +2 -1
- package/lib/es/facade/index.js.map +1 -1
- package/lib/es/index.js +1588 -114
- package/lib/es/index.js.map +1 -1
- package/lib/es/jsx/index.js +1 -1
- package/lib/types/index.d.ts +303 -4
- package/lib/types/jsx/index.d.ts +2 -2
- package/lib/types/jsx/jsx-dev-runtime.d.ts +1 -1
- package/lib/types/jsx/jsx-runtime.d.ts +1 -1
- package/lib/types/{jsx-dev-runtime-Dm72R_Vm.d.ts → jsx-dev-runtime-B1jMa7VW.d.ts} +87 -4
- package/package.json +1 -1
- package/lib/es/chunk-EMSHTYYU.js.map +0 -1
|
@@ -92,7 +92,36 @@ interface IPdfCropBox {
|
|
|
92
92
|
top: number;
|
|
93
93
|
width: number;
|
|
94
94
|
height: number;
|
|
95
|
+
leftPt?: number;
|
|
96
|
+
topPt?: number;
|
|
97
|
+
widthPt?: number;
|
|
98
|
+
heightPt?: number;
|
|
95
99
|
}
|
|
100
|
+
type IPdfCropBoxInput = {
|
|
101
|
+
left: number;
|
|
102
|
+
top: number;
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
leftPt?: number;
|
|
106
|
+
topPt?: number;
|
|
107
|
+
widthPt?: number;
|
|
108
|
+
heightPt?: number;
|
|
109
|
+
} | {
|
|
110
|
+
leftPt: number;
|
|
111
|
+
topPt: number;
|
|
112
|
+
widthPt: number;
|
|
113
|
+
heightPt: number;
|
|
114
|
+
left?: number;
|
|
115
|
+
top?: number;
|
|
116
|
+
width?: number;
|
|
117
|
+
height?: number;
|
|
118
|
+
};
|
|
119
|
+
declare function resolvePdfCropBoxPt(cropBox?: Partial<IPdfCropBox> | null): {
|
|
120
|
+
left: number;
|
|
121
|
+
top: number;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
} | null;
|
|
96
125
|
interface IPdfPage {
|
|
97
126
|
id: string;
|
|
98
127
|
title?: string;
|
|
@@ -140,7 +169,7 @@ declare enum PdfElementType {
|
|
|
140
169
|
ANNOTATION = "annotation",
|
|
141
170
|
REDACTION = "redaction"
|
|
142
171
|
}
|
|
143
|
-
type PdfInteractionMode = 'select' | 'pan' | 'ink' | 'form';
|
|
172
|
+
type PdfInteractionMode = 'select' | 'pan' | 'ink' | 'form' | 'crop';
|
|
144
173
|
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
174
|
type PdfTextOverflowMode = 'clip' | 'shrink' | 'expand';
|
|
146
175
|
type PdfDateTimeKind = 'date' | 'time' | 'dateTime';
|
|
@@ -271,6 +300,7 @@ interface IPdfLayer {
|
|
|
271
300
|
locked?: boolean;
|
|
272
301
|
printable?: boolean;
|
|
273
302
|
}
|
|
303
|
+
type IPdfLayerConfig = IPdfLayer;
|
|
274
304
|
interface IPdfPageElementBase {
|
|
275
305
|
id: string;
|
|
276
306
|
type: PdfElementType;
|
|
@@ -524,9 +554,13 @@ interface IPdfListElement extends IPdfPageElementBase {
|
|
|
524
554
|
}
|
|
525
555
|
interface IPdfStampElement extends IPdfPageElementBase {
|
|
526
556
|
type: PdfElementType.STAMP;
|
|
527
|
-
stampShape?: 'oval' | 'circle' | 'rect';
|
|
557
|
+
stampShape?: 'oval' | 'circle' | 'rect' | 'pill';
|
|
558
|
+
preset?: string;
|
|
528
559
|
primaryText: string;
|
|
529
560
|
secondaryText?: string;
|
|
561
|
+
signer?: string;
|
|
562
|
+
dateText?: string;
|
|
563
|
+
svgContent?: string;
|
|
530
564
|
color?: string;
|
|
531
565
|
}
|
|
532
566
|
interface IPdfInkPoint {
|
|
@@ -549,13 +583,24 @@ declare const PdfAnnotationType: {
|
|
|
549
583
|
readonly STICKY_NOTE: "stickyNote";
|
|
550
584
|
};
|
|
551
585
|
type PdfAnnotationType = (typeof PdfAnnotationType)[keyof typeof PdfAnnotationType];
|
|
552
|
-
type
|
|
586
|
+
type PdfAnnotationReviewStatus = 'open' | 'accepted' | 'rejected' | 'completed' | 'cancelled';
|
|
587
|
+
type PdfAnnotationStatus = PdfAnnotationReviewStatus | 'resolved';
|
|
553
588
|
interface IPdfAnnotationReply {
|
|
554
589
|
id: string;
|
|
555
590
|
author: string;
|
|
556
591
|
content: string;
|
|
557
592
|
createdAt: string;
|
|
558
593
|
}
|
|
594
|
+
interface IPdfCommentThread {
|
|
595
|
+
id: string;
|
|
596
|
+
pageId?: string;
|
|
597
|
+
elementId?: string;
|
|
598
|
+
author: string;
|
|
599
|
+
content: string;
|
|
600
|
+
createdAt?: string;
|
|
601
|
+
reviewStatus?: PdfAnnotationReviewStatus;
|
|
602
|
+
replies?: IPdfAnnotationReply[];
|
|
603
|
+
}
|
|
559
604
|
interface IPdfAnnotationElement extends IPdfPageElementBase {
|
|
560
605
|
type: PdfElementType.ANNOTATION;
|
|
561
606
|
annotationType: PdfAnnotationType;
|
|
@@ -564,6 +609,7 @@ interface IPdfAnnotationElement extends IPdfPageElementBase {
|
|
|
564
609
|
author?: string;
|
|
565
610
|
comment?: string;
|
|
566
611
|
status?: PdfAnnotationStatus;
|
|
612
|
+
reviewStatus?: PdfAnnotationReviewStatus;
|
|
567
613
|
replies?: IPdfAnnotationReply[];
|
|
568
614
|
}
|
|
569
615
|
interface IPdfSignatureElement extends IPdfPageElementBase {
|
|
@@ -604,6 +650,8 @@ interface IPdfBookmarkItem {
|
|
|
604
650
|
pageIndex: number;
|
|
605
651
|
/** Optional vertical offset in pt from top of target page */
|
|
606
652
|
topOffsetPt?: number;
|
|
653
|
+
/** Optional vertical offset alias in pt from top of target page */
|
|
654
|
+
topPt?: number;
|
|
607
655
|
children?: IPdfBookmarkItem[];
|
|
608
656
|
}
|
|
609
657
|
type PdfBatesPosition = 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft';
|
|
@@ -644,6 +692,26 @@ interface IPdfAttachment {
|
|
|
644
692
|
dataBase64: string;
|
|
645
693
|
description?: string;
|
|
646
694
|
}
|
|
695
|
+
interface IPdfSecurityPermissionFlags {
|
|
696
|
+
print?: boolean;
|
|
697
|
+
highResPrint?: boolean;
|
|
698
|
+
modify?: boolean;
|
|
699
|
+
copy?: boolean;
|
|
700
|
+
annotate?: boolean;
|
|
701
|
+
fillForms?: boolean;
|
|
702
|
+
assemble?: boolean;
|
|
703
|
+
}
|
|
704
|
+
interface IPdfSecurityConfig {
|
|
705
|
+
enabled?: boolean;
|
|
706
|
+
/** Open password (user password) required to open the PDF */
|
|
707
|
+
userPassword?: string;
|
|
708
|
+
/** Permissions/master password (owner password) */
|
|
709
|
+
ownerPassword?: string;
|
|
710
|
+
/** Granular PDF Standard Security Handler permission flags */
|
|
711
|
+
permissions?: IPdfSecurityPermissionFlags;
|
|
712
|
+
/** RC4 encryption key length in bits (`40` for V=1/R=2, `128` default for PDF 1.4+ V=2/R=3) */
|
|
713
|
+
keyLength?: 40 | 128;
|
|
714
|
+
}
|
|
647
715
|
interface IPdfSecurityPermissions {
|
|
648
716
|
openPasswordHash?: string;
|
|
649
717
|
ownerPasswordHash?: string;
|
|
@@ -731,6 +799,8 @@ interface IPdfUnitMetadata {
|
|
|
731
799
|
batesConfig?: IPdfBatesConfig;
|
|
732
800
|
/** Embedded file attachments (`/EmbeddedFiles`) */
|
|
733
801
|
attachments?: IPdfAttachment[];
|
|
802
|
+
/** Standard PDF password encryption & permission configuration (`/Standard` RC4) */
|
|
803
|
+
security?: IPdfSecurityConfig;
|
|
734
804
|
/** Document security & permission restrictions */
|
|
735
805
|
securityPermissions?: IPdfSecurityPermissions;
|
|
736
806
|
/** Digital signature SHA-256 envelope */
|
|
@@ -739,6 +809,8 @@ interface IPdfUnitMetadata {
|
|
|
739
809
|
pdfACompliant?: boolean;
|
|
740
810
|
/** Emit PDF/UA `/MarkInfo << /Marked true >>` & `/StructTreeRoot` tagged accessibility tree */
|
|
741
811
|
accessibilityTagged?: boolean;
|
|
812
|
+
/** Optional threaded review comments */
|
|
813
|
+
commentThreads?: IPdfCommentThread[];
|
|
742
814
|
/** True after `sanitizePdfUnit` strips hidden metadata */
|
|
743
815
|
sanitized?: boolean;
|
|
744
816
|
[key: string]: unknown;
|
|
@@ -760,8 +832,12 @@ interface IPdfUnitData {
|
|
|
760
832
|
editState: IPdfDurableEditState;
|
|
761
833
|
/** Optional named PDF Optional Content Group (`/OCProperties`) layers */
|
|
762
834
|
layers?: IPdfLayer[];
|
|
835
|
+
/** Optional navigable PDF outline bookmark tree (`/Outlines`) */
|
|
836
|
+
bookmarks?: IPdfBookmarkItem[];
|
|
763
837
|
/** Optional embedded file attachments (`/Names /EmbeddedFiles`) */
|
|
764
838
|
attachments?: IPdfAttachment[];
|
|
839
|
+
/** Optional standard PDF password encryption & permissions (`/Standard` RC4) */
|
|
840
|
+
security?: IPdfSecurityConfig;
|
|
765
841
|
/** Optional document security & permission restrictions */
|
|
766
842
|
securityPermissions?: IPdfSecurityPermissions;
|
|
767
843
|
/** Optional deterministic SHA-256 digital signature envelope */
|
|
@@ -1256,6 +1332,8 @@ interface IPdfExportOptions {
|
|
|
1256
1332
|
accessibilityTagged?: boolean;
|
|
1257
1333
|
/** Compresses uncompressed streams with FlateDecode & prunes unreferenced indirect objects */
|
|
1258
1334
|
optimizeSize?: boolean;
|
|
1335
|
+
/** Optional standard PDF password encryption & permission restrictions (`/Standard` RC4) */
|
|
1336
|
+
security?: IPdfSecurityConfig;
|
|
1259
1337
|
/** Optional `AbortSignal` to cancel PDF compilation before or during async rendering */
|
|
1260
1338
|
signal?: AbortSignal;
|
|
1261
1339
|
}
|
|
@@ -1376,6 +1454,11 @@ declare function formatBatesNumber(batesConfig: IPdfBatesConfig, pageZeroIndex:
|
|
|
1376
1454
|
* Compiles a Univer `IPdfUnitData` snapshot (plus optional dataset values & export options) into standard PDF bytes.
|
|
1377
1455
|
*/
|
|
1378
1456
|
declare function exportPdfBytes(snapshot: IPdfUnitData, runtimeData?: Record<string, unknown>, options?: IPdfExportOptions): Promise<Uint8Array>;
|
|
1457
|
+
/**
|
|
1458
|
+
* Alias for `exportPdfBytes`: compiles an `IPdfUnitData` snapshot (with optional dataset bindings
|
|
1459
|
+
* and `unit.security` / `options.security` encryption) into PDF binary bytes (`Uint8Array`).
|
|
1460
|
+
*/
|
|
1461
|
+
declare const exportPdfUnitToBytes: typeof exportPdfBytes;
|
|
1379
1462
|
/**
|
|
1380
1463
|
* Loads an interactive PDF binary (`Uint8Array`) via `PDFDocument.load`, inspects all `AcroForm`
|
|
1381
1464
|
* fields (`PDFTextField`, `PDFCheckBox`, `PDFDropdown`, `PDFOptionList`, `PDFRadioGroup`, `/FT /Sig`),
|
|
@@ -1731,4 +1814,4 @@ declare namespace JSX {
|
|
|
1731
1814
|
}
|
|
1732
1815
|
}
|
|
1733
1816
|
|
|
1734
|
-
export { type
|
|
1817
|
+
export { type IExportJsxToPdfOptions as $, type IPdfCircleMarkElement as A, type IPdfListElement as B, type IPdfRichTextSpan as C, type PdfColorSpaceType as D, type IPdfExportOptions as E, PDF_PAGE_PRESETS as F, type PdfBatesPosition as G, type IPdfSignerInfo as H, type IPdfUnitData as I, type IPdfSecurityPermissionFlags as J, type IPdfStampElement as K, type IPdfSvgElement as L, type IPdfjsAssetsConfig as M, type PdfDisplayUnit as N, type PdfInteractionMode as O, PdfElementType as P, type IPdfVersionSnapshot as Q, DEFAULT_PDF_CJK_FONT_FAMILY as R, DEFAULT_PDF_CJK_FONT_FILES as S, DEFAULT_PDF_CJK_FONT_PACKAGE as T, DEFAULT_PDF_CJK_FONT_VERSION as U, Fragment as V, type ICjkDetectionSummary as W, type IComputeDynamicFontSizeParams as X, type IDetectedPaperPreset as Y, type IDiagnosePdfFontsOptions as Z, type IDiagnosticGridOverlayOptions as _, type IPdfDocument as a, type IPdfRenderWarning as a$, type IInputsCjkReport as a0, type IJsxAbsoluteProps as a1, type IJsxBarcodeProps as a2, type IJsxBoxProps as a3, type IJsxContainerStyleProps as a4, type IJsxDocumentProps as a5, type IJsxHeaderFooterProps as a6, type IJsxImageProps as a7, type IJsxLineProps as a8, type IJsxListProps as a9, type IPdfElementBase as aA, type IPdfElementTransform as aB, type IPdfEllipseElement as aC, type IPdfExportCapabilitiesReport as aD, type IPdfFailedFontEntry as aE, type IPdfFieldContractHint as aF, type IPdfFontDiagnosisReport as aG, type IPdfFontDiagnosticIssue as aH, type IPdfFontDoctorInputEntry as aI, type IPdfFontSource as aJ, type IPdfImageCrop as aK, type IPdfImageElement as aL, type IPdfInkElement as aM, type IPdfInkPoint as aN, type IPdfInputContractValidationResult as aO, type IPdfInputContractViolation as aP, type IPdfJsxNode as aQ, type IPdfLayerConfig as aR, type IPdfLineElement as aS, type IPdfMissingGlyphItem as aT, type IPdfPageElementBase as aU, type IPdfParagraphBlock as aV, type IPdfPolygonElement as aW, type IPdfPolygonPoint as aX, type IPdfQrCodeElement as aY, type IPdfRadioGroupElement as aZ, type IPdfRedactionElement as a_, type IJsxMultiVariableTextProps as aa, type IJsxPageBreakProps as ab, type IJsxPageProps as ac, type IJsxQrCodeProps as ad, type IJsxRowProps as ae, type IJsxShapeProps as af, type IJsxSpacerProps as ag, type IJsxStackProps as ah, type IJsxStaticProps as ai, type IJsxSvgProps as aj, type IJsxTableColumnSpec as ak, type IJsxTableProps as al, type IJsxTextProps as am, type IPdfAnnotationElement as an, type IPdfBarcodeElement as ao, type IPdfBrowserRenderOptions as ap, type IPdfCheckboxElement as aq, type IPdfCjkFontSourcesOptions as ar, type IPdfCommentThread as as, type IPdfDatasetField as at, type IPdfDatasetSchema as au, type IPdfDateTimeElement as av, type IPdfDocumentMetadata as aw, type IPdfDurableEditState as ax, type IPdfDynamicFontSizeConfig as ay, type IPdfElement as az, type IPdfPage as b, computeDynamicFontSize as b$, type IPdfSchemaDiagnosticIssue as b0, type IPdfSelectElement as b1, type IPdfShapeElement as b2, type IPdfSignatureElement as b3, type IPdfTableBorderWidths as b4, type IPdfTableCellStyle as b5, type IPdfTableColumn as b6, type IPdfTableElement as b7, type IPdfTableMerge as b8, type IPdfTablePageChunk as b9, type PdfFontFallbackPolicy as bA, PdfImageSourceType as bB, type PdfJsxChild as bC, type PdfJsxComponent as bD, type PdfJsxIntrinsicKind as bE, type PdfJsxPaddingSpec as bF, PdfListKind as bG, PdfListPresetId as bH, type PdfMissingGlyphPolicy as bI, type PdfPaperPresetName as bJ, PdfRenderError as bK, PdfTableBorderStyle as bL, PdfTableCellVerticalAlign as bM, type PdfTablePaginationMode as bN, PdfTextAnchor as bO, type PdfTextFormatMode as bP, type PdfTextOverflowMode as bQ, type PdfZebraParityMode as bR, UNIVER_PDF_SCHEMA as bS, UNIVER_PDF_SCHEMA_VERSION as bT, buildMinimalTestTrueTypeFont as bU, calculatePdfTableRowCapacity as bV, clearPdfFontUrlCache as bW, collectMissingGlyphsFromPdfUnit as bX, collectPdfInputContractHints as bY, collectUsedCodePointsFromPdfUnit as bZ, computeAutoFitFontSize as b_, type IPdfTablePaginationOptions as ba, type IPdfTableRowCapacity as bb, type IPdfTableThemePreset as bc, type IPdfTemplateSchemaValidationResult as bd, type IPdfVariableValidationResult as be, type IPdfmeBlankPdf as bf, type IPdfmeSchemaItem as bg, type IPdfmeTemplate as bh, type IRenderJsxOptions as bi, type ISubsetFontResult as bj, type ITemplateCjkReport as bk, type ITrueTypeFontInspection as bl, type IValidatePdfTemplateSchemaOptions as bm, JSX as bn, PAGE_SIZE_PRESETS_MM as bo, PDF_JSX_ELEMENT_SYMBOL as bp, PDF_JSX_FRAGMENT_SYMBOL as bq, PDF_TABLE_THEME_PRESETS as br, PT_PER_MM as bs, type PdfAnnotationStatus as bt, PdfAnnotationType as bu, type PdfBarcodeFormat as bv, type PdfCjkScriptBlock as bw, type PdfCjkTextMode as bx, type PdfDynamicFontFitMode as by, type PdfFontFailureKind as bz, type IPdfPageSize as c, computeFontUrlCacheKey as c0, computePdfTableSummaryRow as c1, createPdfCjkFontSources as c2, createPdfJsxNode as c3, detectCJKCharacters as c4, detectCJKInPdfInputs as c5, detectCJKInPdfTemplate as c6, detectPaperSizePreset as c7, diagnosePdfFonts as c8, evaluatePdfJsxElement as c9, paginatePdfTableRows as cA, ptToMm as cB, renderBarcodeDataUrl as cC, renderQrCodeDataUrl as cD, resolveDynamicTableRawRows as cE, resolvePaddingMm as cF, resolvePageSizeMm as cG, resolvePdfCropBoxPt as cH, resolvePolygonNormalizedPoints as cI, resolveTemplateString as cJ, subsetTrueTypeFont as cK, toPdfmeTemplate as cL, validatePdfInputContract as cM, validatePdfTemplateSchema as cN, validatePdfTemplateVariables as cO, wrapMixedCjkAndLatinLines as cP, exportBatchPdfBytes as ca, exportCalibrationGridPdfBytes as cb, exportPdfBytes as cc, exportPdfUnitToBytes as cd, exportToPdfmeTemplate as ce, extractAcroFormValuesFromPdfBytes as cf, extractJsxTextContent as cg, extractPdfFormValues as ch, fillPdfFormValues as ci, flattenJsxChildrenToNodes as cj, formatBatesNumber as ck, formatPdfTableCell as cl, fromPdfmeTemplate as cm, getTrueTypeMappedCodePoints as cn, importFromPdfmeTemplate as co, inspectPdfExportCapabilities as cp, inspectTrueTypeFont as cq, isFontUrlSafeToFetch as cr, isPdfJsxNode as cs, jsx as ct, jsxDEV as cu, jsxs as cv, mmToPt as cw, normalizeBarcodePayloadForFormat as cx, normalizeImageCrop as cy, overlayDiagnosticGridOnPdfBytes as cz, type IPdfPageElement as d, type IPdfLayer as e, type IPdfSourceDocumentRef as f, type IPdfResourceBinding as g, type IPdfUnitMetadata as h, type IPdfBookmarkItem as i, type IPdfAttachment as j, type IPdfSecurityConfig as k, type IPdfSecurityPermissions as l, type IPdfSignatureEnvelope as m, type IPdfAnnotationReply as n, type IPdfTextStyle as o, type PdfPageRotation as p, type PdfAnnotationReviewStatus as q, type IPdfBatesConfig as r, type IPdfHeaderFooterConfig as s, type IPdfNativeTextSpan as t, type IPdfCropBox as u, type IPdfCropBoxInput as v, type IPdfWatermarkConfig as w, type IPdfDocumentData as x, type IPdfTextElement as y, type PdfDateTimeKind as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yudaocode/univer-pdfs",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.219",
|
|
4
4
|
"description": "Univer PDFs core unit model, commands, PDF exporter, JSX layout DSL, and template adapter",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/yudaocode/yudao-univer#readme",
|