@yudaocode/univer-pdfs 1.6.215 → 1.6.217
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/PDF_BROWSER_RENDERING_CONTRACT.md +288 -22
- package/fixtures/pdf-s1-s7-fidelity-v1.json +2010 -0
- package/lib/cjs/facade/index.js +18 -10
- package/lib/cjs/facade/index.js.map +1 -1
- package/lib/cjs/index.js +557 -100
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/jsx/index.js +143 -68
- package/lib/cjs/jsx/index.js.map +1 -1
- package/lib/es/{chunk-DYTQBEM7.js → chunk-EMSHTYYU.js} +148 -70
- package/lib/es/chunk-EMSHTYYU.js.map +1 -0
- package/lib/es/facade/index.js +19 -10
- package/lib/es/facade/index.js.map +1 -1
- package/lib/es/index.js +408 -32
- package/lib/es/index.js.map +1 -1
- package/lib/es/jsx/index.js +1 -1
- package/lib/types/facade/index.d.ts +3 -0
- package/lib/types/index.d.ts +74 -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-BFeiWVJj.d.ts → jsx-dev-runtime-Dm72R_Vm.d.ts} +15 -1
- package/package.json +3 -1
- package/lib/es/chunk-DYTQBEM7.js.map +0 -1
package/lib/es/jsx/index.js
CHANGED
|
@@ -725,6 +725,8 @@ declare class FPdf {
|
|
|
725
725
|
getIoCapabilities(): IPdfIoCapabilities;
|
|
726
726
|
importPdfFile(file: File, options?: {
|
|
727
727
|
target?: PdfIoTarget;
|
|
728
|
+
password?: string;
|
|
729
|
+
signal?: AbortSignal;
|
|
728
730
|
}): Promise<IPdfImportOutcome>;
|
|
729
731
|
/**
|
|
730
732
|
* Generates standard PDF binary bytes (`Uint8Array`) with optional dynamic dataset data and export options.
|
|
@@ -732,6 +734,7 @@ declare class FPdf {
|
|
|
732
734
|
*/
|
|
733
735
|
exportPdf(data?: Record<string, unknown>, options?: {
|
|
734
736
|
target?: PdfIoTarget;
|
|
737
|
+
signal?: AbortSignal;
|
|
735
738
|
} & IPdfExportOptions): Promise<Uint8Array>;
|
|
736
739
|
/**
|
|
737
740
|
* Exports standard PDF bytes with interactive `AcroForm` widgets (`PDFTextField`, `PDFCheckBox`,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IPdfUnitData, a as IPdfDocument, b as IPdfPage, c as IPdfPageSize, d as IPdfPageElement, e as IPdfLayer, f as IPdfSourceDocumentRef, g as IPdfResourceBinding, h as IPdfUnitMetadata, i as IPdfAttachment, j as IPdfSecurityPermissions, k as IPdfSignatureEnvelope, P as PdfElementType, l as IPdfTextStyle, m as PdfPageRotation, n as IPdfBatesConfig, o as IPdfBookmarkItem, p as IPdfHeaderFooterConfig, q as IPdfNativeTextSpan, r as IPdfCropBox, s as IPdfWatermarkConfig, t as IPdfDocumentData, u as IPdfTextElement, v as PdfDateTimeKind, w as IPdfCircleMarkElement, x as IPdfListElement, y as IPdfRichTextSpan, z as PdfColorSpaceType, A as IPdfExportOptions, B as PDF_PAGE_PRESETS, C as PdfBatesPosition, D as IPdfSignerInfo, E as IPdfjsAssetsConfig, F as PdfDisplayUnit, G as PdfInteractionMode, H as IPdfVersionSnapshot } from './jsx-dev-runtime-
|
|
2
|
-
export { J as DEFAULT_PDF_CJK_FONT_FAMILY, K as DEFAULT_PDF_CJK_FONT_FILES, L as DEFAULT_PDF_CJK_FONT_PACKAGE, M as DEFAULT_PDF_CJK_FONT_VERSION, N as Fragment, O as ICjkDetectionSummary, Q as IComputeDynamicFontSizeParams, R as IDetectedPaperPreset, S as IDiagnosePdfFontsOptions, T as IDiagnosticGridOverlayOptions, U as IExportJsxToPdfOptions, V as IInputsCjkReport, W as IJsxAbsoluteProps, X as IJsxBarcodeProps, Y as IJsxBoxProps, Z as IJsxContainerStyleProps, _ as IJsxDocumentProps, $ as IJsxHeaderFooterProps, a0 as IJsxImageProps, a1 as IJsxLineProps, a2 as IJsxListProps, a3 as IJsxMultiVariableTextProps, a4 as IJsxPageBreakProps, a5 as IJsxPageProps, a6 as IJsxQrCodeProps, a7 as IJsxRowProps, a8 as IJsxShapeProps, a9 as IJsxSpacerProps, aa as IJsxStackProps, ab as IJsxStaticProps, ac as IJsxSvgProps, ad as IJsxTableColumnSpec, ae as IJsxTableProps, af as IJsxTextProps, ag as IPdfAnnotationElement, ah as IPdfAnnotationReply, ai as IPdfBarcodeElement, aj as IPdfBrowserRenderOptions, ak as IPdfCheckboxElement, al as IPdfCjkFontSourcesOptions, am as IPdfDatasetField, an as IPdfDatasetSchema, ao as IPdfDateTimeElement, ap as IPdfDocumentMetadata, aq as IPdfDurableEditState, ar as IPdfDynamicFontSizeConfig, as as IPdfElement, at as IPdfElementBase, au as IPdfElementTransform, av as IPdfEllipseElement, aw as IPdfExportCapabilitiesReport, ax as IPdfFailedFontEntry, ay as IPdfFieldContractHint, az as IPdfFontDiagnosisReport, aA as IPdfFontDiagnosticIssue, aB as IPdfFontDoctorInputEntry, aC as IPdfFontSource, aD as IPdfImageCrop, aE as IPdfImageElement, aF as IPdfInkElement, aG as IPdfInkPoint, aH as IPdfInputContractValidationResult, aI as IPdfInputContractViolation, aJ as IPdfJsxNode, aK as IPdfLineElement, aL as IPdfMissingGlyphItem, aM as IPdfPageElementBase, aN as IPdfParagraphBlock, aO as IPdfPolygonElement, aP as IPdfPolygonPoint, aQ as IPdfQrCodeElement, aR as IPdfRadioGroupElement, aS as IPdfRedactionElement, aT as IPdfRenderWarning, aU as IPdfSchemaDiagnosticIssue, aV as IPdfSelectElement, aW as IPdfShapeElement, aX as IPdfSignatureElement, aY as IPdfStampElement, aZ as IPdfSvgElement, a_ as IPdfTableBorderWidths, a$ as IPdfTableCellStyle, b0 as IPdfTableColumn, b1 as IPdfTableElement, b2 as IPdfTableMerge, b3 as IPdfTablePageChunk, b4 as IPdfTablePaginationOptions, b5 as IPdfTableRowCapacity, b6 as IPdfTableThemePreset, b7 as IPdfTemplateSchemaValidationResult, b8 as IPdfVariableValidationResult, b9 as IPdfmeBlankPdf, ba as IPdfmeSchemaItem, bb as IPdfmeTemplate, bc as IRenderJsxOptions, bd as ISubsetFontResult, be as ITemplateCjkReport, bf as ITrueTypeFontInspection, bg as IValidatePdfTemplateSchemaOptions, bh as JSX, bi as PAGE_SIZE_PRESETS_MM, bj as PDF_JSX_ELEMENT_SYMBOL, bk as PDF_JSX_FRAGMENT_SYMBOL, bl as PDF_TABLE_THEME_PRESETS, bm as PT_PER_MM, bn as PdfAnnotationStatus, bo as PdfAnnotationType, bp as PdfBarcodeFormat, bq as PdfCjkScriptBlock, br as PdfCjkTextMode, bs as PdfDynamicFontFitMode, bt as
|
|
1
|
+
import { I as IPdfUnitData, a as IPdfDocument, b as IPdfPage, c as IPdfPageSize, d as IPdfPageElement, e as IPdfLayer, f as IPdfSourceDocumentRef, g as IPdfResourceBinding, h as IPdfUnitMetadata, i as IPdfAttachment, j as IPdfSecurityPermissions, k as IPdfSignatureEnvelope, P as PdfElementType, l as IPdfTextStyle, m as PdfPageRotation, n as IPdfBatesConfig, o as IPdfBookmarkItem, p as IPdfHeaderFooterConfig, q as IPdfNativeTextSpan, r as IPdfCropBox, s as IPdfWatermarkConfig, t as IPdfDocumentData, u as IPdfTextElement, v as PdfDateTimeKind, w as IPdfCircleMarkElement, x as IPdfListElement, y as IPdfRichTextSpan, z as PdfColorSpaceType, A as IPdfExportOptions, B as PDF_PAGE_PRESETS, C as PdfBatesPosition, D as IPdfSignerInfo, E as IPdfjsAssetsConfig, F as PdfDisplayUnit, G as PdfInteractionMode, H as IPdfVersionSnapshot } from './jsx-dev-runtime-Dm72R_Vm.js';
|
|
2
|
+
export { J as DEFAULT_PDF_CJK_FONT_FAMILY, K as DEFAULT_PDF_CJK_FONT_FILES, L as DEFAULT_PDF_CJK_FONT_PACKAGE, M as DEFAULT_PDF_CJK_FONT_VERSION, N as Fragment, O as ICjkDetectionSummary, Q as IComputeDynamicFontSizeParams, R as IDetectedPaperPreset, S as IDiagnosePdfFontsOptions, T as IDiagnosticGridOverlayOptions, U as IExportJsxToPdfOptions, V as IInputsCjkReport, W as IJsxAbsoluteProps, X as IJsxBarcodeProps, Y as IJsxBoxProps, Z as IJsxContainerStyleProps, _ as IJsxDocumentProps, $ as IJsxHeaderFooterProps, a0 as IJsxImageProps, a1 as IJsxLineProps, a2 as IJsxListProps, a3 as IJsxMultiVariableTextProps, a4 as IJsxPageBreakProps, a5 as IJsxPageProps, a6 as IJsxQrCodeProps, a7 as IJsxRowProps, a8 as IJsxShapeProps, a9 as IJsxSpacerProps, aa as IJsxStackProps, ab as IJsxStaticProps, ac as IJsxSvgProps, ad as IJsxTableColumnSpec, ae as IJsxTableProps, af as IJsxTextProps, ag as IPdfAnnotationElement, ah as IPdfAnnotationReply, ai as IPdfBarcodeElement, aj as IPdfBrowserRenderOptions, ak as IPdfCheckboxElement, al as IPdfCjkFontSourcesOptions, am as IPdfDatasetField, an as IPdfDatasetSchema, ao as IPdfDateTimeElement, ap as IPdfDocumentMetadata, aq as IPdfDurableEditState, ar as IPdfDynamicFontSizeConfig, as as IPdfElement, at as IPdfElementBase, au as IPdfElementTransform, av as IPdfEllipseElement, aw as IPdfExportCapabilitiesReport, ax as IPdfFailedFontEntry, ay as IPdfFieldContractHint, az as IPdfFontDiagnosisReport, aA as IPdfFontDiagnosticIssue, aB as IPdfFontDoctorInputEntry, aC as IPdfFontSource, aD as IPdfImageCrop, aE as IPdfImageElement, aF as IPdfInkElement, aG as IPdfInkPoint, aH as IPdfInputContractValidationResult, aI as IPdfInputContractViolation, aJ as IPdfJsxNode, aK as IPdfLineElement, aL as IPdfMissingGlyphItem, aM as IPdfPageElementBase, aN as IPdfParagraphBlock, aO as IPdfPolygonElement, aP as IPdfPolygonPoint, aQ as IPdfQrCodeElement, aR as IPdfRadioGroupElement, aS as IPdfRedactionElement, aT as IPdfRenderWarning, aU as IPdfSchemaDiagnosticIssue, aV as IPdfSelectElement, aW as IPdfShapeElement, aX as IPdfSignatureElement, aY as IPdfStampElement, aZ as IPdfSvgElement, a_ as IPdfTableBorderWidths, a$ as IPdfTableCellStyle, b0 as IPdfTableColumn, b1 as IPdfTableElement, b2 as IPdfTableMerge, b3 as IPdfTablePageChunk, b4 as IPdfTablePaginationOptions, b5 as IPdfTableRowCapacity, b6 as IPdfTableThemePreset, b7 as IPdfTemplateSchemaValidationResult, b8 as IPdfVariableValidationResult, b9 as IPdfmeBlankPdf, ba as IPdfmeSchemaItem, bb as IPdfmeTemplate, bc as IRenderJsxOptions, bd as ISubsetFontResult, be as ITemplateCjkReport, bf as ITrueTypeFontInspection, bg as IValidatePdfTemplateSchemaOptions, bh as JSX, bi as PAGE_SIZE_PRESETS_MM, bj as PDF_JSX_ELEMENT_SYMBOL, bk as PDF_JSX_FRAGMENT_SYMBOL, bl as PDF_TABLE_THEME_PRESETS, bm as PT_PER_MM, bn as PdfAnnotationStatus, bo as PdfAnnotationType, bp as PdfBarcodeFormat, bq as PdfCjkScriptBlock, br as PdfCjkTextMode, bs as PdfDynamicFontFitMode, bt as PdfFontFailureKind, bu as PdfFontFallbackPolicy, bv as PdfImageSourceType, bw as PdfJsxChild, bx as PdfJsxComponent, by as PdfJsxIntrinsicKind, bz as PdfJsxPaddingSpec, bA as PdfListKind, bB as PdfListPresetId, bC as PdfMissingGlyphPolicy, bD as PdfPaperPresetName, bE as PdfRenderError, bF as PdfTableBorderStyle, bG as PdfTableCellVerticalAlign, bH as PdfTablePaginationMode, bI as PdfTextAnchor, bJ as PdfTextFormatMode, bK as PdfTextOverflowMode, bL as PdfZebraParityMode, bM as UNIVER_PDF_SCHEMA, bN as UNIVER_PDF_SCHEMA_VERSION, bO as buildMinimalTestTrueTypeFont, bP as calculatePdfTableRowCapacity, bQ as clearPdfFontUrlCache, bR as collectMissingGlyphsFromPdfUnit, bS as collectPdfInputContractHints, bT as collectUsedCodePointsFromPdfUnit, bU as computeAutoFitFontSize, bV as computeDynamicFontSize, bW as computeFontUrlCacheKey, bX as computePdfTableSummaryRow, bY as createPdfCjkFontSources, bZ as createPdfJsxNode, b_ as detectCJKCharacters, b$ as detectCJKInPdfInputs, c0 as detectCJKInPdfTemplate, c1 as detectPaperSizePreset, c2 as diagnosePdfFonts, c3 as evaluatePdfJsxElement, c4 as exportBatchPdfBytes, c5 as exportCalibrationGridPdfBytes, c6 as exportPdfBytes, c7 as exportToPdfmeTemplate, c8 as extractAcroFormValuesFromPdfBytes, c9 as extractJsxTextContent, ca as extractPdfFormValues, cb as fillPdfFormValues, cc as flattenJsxChildrenToNodes, cd as formatBatesNumber, ce as formatPdfTableCell, cf as fromPdfmeTemplate, cg as getTrueTypeMappedCodePoints, ch as importFromPdfmeTemplate, ci as inspectPdfExportCapabilities, cj as inspectTrueTypeFont, ck as isFontUrlSafeToFetch, cl as isPdfJsxNode, cm as jsx, cn as jsxDEV, co as jsxs, cp as mmToPt, cq as normalizeBarcodePayloadForFormat, cr as normalizeImageCrop, cs as overlayDiagnosticGridOnPdfBytes, ct as paginatePdfTableRows, cu as ptToMm, cv as renderBarcodeDataUrl, cw as renderQrCodeDataUrl, cx as resolveDynamicTableRawRows, cy as resolvePaddingMm, cz as resolvePageSizeMm, cA as resolvePolygonNormalizedPoints, cB as resolveTemplateString, cC as subsetTrueTypeFont, cD as toPdfmeTemplate, cE as validatePdfInputContract, cF as validatePdfTemplateSchema, cG as validatePdfTemplateVariables, cH as wrapMixedCjkAndLatinLines } from './jsx-dev-runtime-Dm72R_Vm.js';
|
|
3
3
|
import * as _univerjs_core from '@univerjs/core';
|
|
4
4
|
import { UnitModel, UniverInstanceType, ICommand, IMutation, IDisposable, Disposable, IUniverInstanceService, Plugin, Injector, ICommandService } from '@univerjs/core';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
@@ -1580,6 +1580,46 @@ interface IPdfBrowserFidelitySampleSet {
|
|
|
1580
1580
|
* for verifying browser PDF preview & export fidelity without external dataset binding.
|
|
1581
1581
|
*/
|
|
1582
1582
|
declare function createPdfBrowserFidelitySamples(): IPdfBrowserFidelitySampleSet;
|
|
1583
|
+
type PdfBrowserFidelitySampleKey = keyof IPdfBrowserFidelitySampleSet;
|
|
1584
|
+
interface IPdfBrowserFidelityRenderScenario {
|
|
1585
|
+
cjkTextMode: 'subset-ttf' | 'raster-hd' | 'cid-vector';
|
|
1586
|
+
suppliesSubsetFont: boolean;
|
|
1587
|
+
omitsRenderOptions: boolean;
|
|
1588
|
+
missingGlyph?: 'error' | 'warn';
|
|
1589
|
+
description: string;
|
|
1590
|
+
}
|
|
1591
|
+
interface IPdfBrowserFidelityStrictErrorExpectation {
|
|
1592
|
+
code: 'MISSING_GLYPH';
|
|
1593
|
+
pageId?: string;
|
|
1594
|
+
elementId?: string;
|
|
1595
|
+
missingCodePoints: string[];
|
|
1596
|
+
}
|
|
1597
|
+
interface IPdfBrowserFidelityExpectedOutcome {
|
|
1598
|
+
pageCount: number;
|
|
1599
|
+
tableRowsPerPage: number[];
|
|
1600
|
+
extractableTextSnippetsByPage: string[][];
|
|
1601
|
+
embedsType0SubsetFont: boolean;
|
|
1602
|
+
usesRasterTextImages: boolean;
|
|
1603
|
+
expectedErrorWhenStrict?: IPdfBrowserFidelityStrictErrorExpectation;
|
|
1604
|
+
}
|
|
1605
|
+
interface IPdfBrowserFidelityExpectationEntry {
|
|
1606
|
+
id: 'S1' | 'S2' | 'S3' | 'S4' | 'S5' | 'S6' | 'S7';
|
|
1607
|
+
sampleKey: PdfBrowserFidelitySampleKey;
|
|
1608
|
+
title: string;
|
|
1609
|
+
inputSnapshot: IPdfUnitData;
|
|
1610
|
+
renderScenario: IPdfBrowserFidelityRenderScenario;
|
|
1611
|
+
expected: IPdfBrowserFidelityExpectedOutcome;
|
|
1612
|
+
}
|
|
1613
|
+
interface IPdfBrowserFidelityExpectationSuite {
|
|
1614
|
+
schema: 'univer-pdf-fidelity-expectations';
|
|
1615
|
+
version: 1;
|
|
1616
|
+
samples: IPdfBrowserFidelityExpectationEntry[];
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* Builds the canonical S1–S7 golden expectations suite matching `fixtures/pdf-s1-s7-fidelity-v1.json`.
|
|
1620
|
+
*/
|
|
1621
|
+
declare function createPdfBrowserFidelityExpectations(): IPdfBrowserFidelityExpectationSuite;
|
|
1622
|
+
declare const PDF_S1_S7_FIDELITY_EXPECTATIONS: Readonly<IPdfBrowserFidelityExpectationSuite>;
|
|
1583
1623
|
|
|
1584
1624
|
interface IPdfImportWarning {
|
|
1585
1625
|
code: string;
|
|
@@ -1618,24 +1658,38 @@ interface IPdfImportOutcomeReport {
|
|
|
1618
1658
|
executedBy: 'browser' | 'server';
|
|
1619
1659
|
fileName?: string;
|
|
1620
1660
|
}
|
|
1621
|
-
interface
|
|
1661
|
+
interface IPdfImportOptions {
|
|
1622
1662
|
unitId?: string;
|
|
1623
1663
|
snapshot?: IPdfUnitData;
|
|
1624
1664
|
target?: PdfIoTarget;
|
|
1625
1665
|
password?: string;
|
|
1666
|
+
fileName?: string;
|
|
1667
|
+
signal?: AbortSignal;
|
|
1626
1668
|
defaultImport?: (file: File) => Promise<any>;
|
|
1627
1669
|
}
|
|
1670
|
+
interface IPdfImportWithReportContext extends IPdfImportOptions {
|
|
1671
|
+
}
|
|
1628
1672
|
interface IPdfImportContext {
|
|
1629
1673
|
unitId: string;
|
|
1630
1674
|
snapshot: IPdfUnitData;
|
|
1675
|
+
signal?: AbortSignal;
|
|
1631
1676
|
/** Built-in pure frontend importer fallback */
|
|
1632
1677
|
defaultImport: (file: File) => Promise<IPdfImportOutcome>;
|
|
1633
1678
|
}
|
|
1679
|
+
interface IPdfExportUnifiedOptions {
|
|
1680
|
+
unitId?: string;
|
|
1681
|
+
snapshot?: IPdfUnitData;
|
|
1682
|
+
data?: Record<string, unknown>;
|
|
1683
|
+
options?: IPdfExportOptions;
|
|
1684
|
+
target?: PdfIoTarget;
|
|
1685
|
+
signal?: AbortSignal;
|
|
1686
|
+
}
|
|
1634
1687
|
interface IPdfExportContext {
|
|
1635
1688
|
unitId: string;
|
|
1636
1689
|
snapshot: IPdfUnitData;
|
|
1637
1690
|
data?: Record<string, unknown>;
|
|
1638
1691
|
options?: IPdfExportOptions;
|
|
1692
|
+
signal?: AbortSignal;
|
|
1639
1693
|
/** Built-in pure frontend PDF generator (`pdf-lib` + CJK rendering + QR/Barcode) */
|
|
1640
1694
|
defaultExport: () => Promise<Uint8Array>;
|
|
1641
1695
|
}
|
|
@@ -1789,6 +1843,7 @@ interface IPdfIoService {
|
|
|
1789
1843
|
defaultImport?: (file: File) => Promise<IPdfImportOutcome>;
|
|
1790
1844
|
target?: PdfIoTarget;
|
|
1791
1845
|
password?: string;
|
|
1846
|
+
signal?: AbortSignal;
|
|
1792
1847
|
}): Promise<IPdfImportOutcome>;
|
|
1793
1848
|
importPdfWithReport(file: File, context?: IPdfImportWithReportContext): Promise<IPdfImportOutcomeReport>;
|
|
1794
1849
|
exportPdf(params: {
|
|
@@ -1797,7 +1852,9 @@ interface IPdfIoService {
|
|
|
1797
1852
|
data?: Record<string, unknown>;
|
|
1798
1853
|
options?: IPdfExportOptions;
|
|
1799
1854
|
target?: PdfIoTarget;
|
|
1855
|
+
signal?: AbortSignal;
|
|
1800
1856
|
}): Promise<Uint8Array>;
|
|
1857
|
+
exportPdfWithTarget(params: IPdfExportUnifiedOptions): Promise<Uint8Array>;
|
|
1801
1858
|
silentPrint(params: {
|
|
1802
1859
|
unitId: string;
|
|
1803
1860
|
snapshot: IPdfUnitData;
|
|
@@ -1816,6 +1873,7 @@ declare const IPdfIoService: _univerjs_core.IdentifierDecorator<IPdfIoService>;
|
|
|
1816
1873
|
interface IPdfImportSourceOptions {
|
|
1817
1874
|
fileName?: string;
|
|
1818
1875
|
password?: string;
|
|
1876
|
+
signal?: AbortSignal;
|
|
1819
1877
|
}
|
|
1820
1878
|
type IPdfImportSourceResult = IPdfImportOutcome & {
|
|
1821
1879
|
mode: 'overlay';
|
|
@@ -1826,6 +1884,7 @@ declare function normalizePdfImportWarnings(raw?: ReadonlyArray<IPdfImportWarnin
|
|
|
1826
1884
|
declare function buildOverlayImportCandidateSnapshot(baseSnapshot: IPdfUnitData, outcome: Extract<IPdfImportOutcome, {
|
|
1827
1885
|
mode: 'overlay';
|
|
1828
1886
|
}>): IPdfUnitData;
|
|
1887
|
+
declare function createPdfAbortError(signal?: AbortSignal): DOMException | Error;
|
|
1829
1888
|
/**
|
|
1830
1889
|
* Validates and imports a PDF source (`File`, `Blob`, `ArrayBuffer`, `Uint8Array`, or Base64 / Data URI string).
|
|
1831
1890
|
* Strictly verifies the `%PDF-` magic header and `PDFDocument.load` structure (with optional `password`),
|
|
@@ -1872,14 +1931,17 @@ declare class PdfIoService extends Disposable implements IPdfIoService {
|
|
|
1872
1931
|
defaultImport?: (file: File) => Promise<IPdfImportOutcome>;
|
|
1873
1932
|
target?: PdfIoTarget;
|
|
1874
1933
|
password?: string;
|
|
1934
|
+
signal?: AbortSignal;
|
|
1875
1935
|
}): Promise<IPdfImportOutcome>;
|
|
1876
1936
|
importPdfWithReport(file: File, context?: IPdfImportWithReportContext): Promise<IPdfImportOutcomeReport>;
|
|
1937
|
+
exportPdfWithTarget(params: IPdfExportUnifiedOptions): Promise<Uint8Array>;
|
|
1877
1938
|
exportPdf(params: {
|
|
1878
1939
|
unitId: string;
|
|
1879
1940
|
snapshot: IPdfUnitData;
|
|
1880
1941
|
data?: Record<string, unknown>;
|
|
1881
1942
|
options?: IPdfExportOptions;
|
|
1882
1943
|
target?: PdfIoTarget;
|
|
1944
|
+
signal?: AbortSignal;
|
|
1883
1945
|
}): Promise<Uint8Array>;
|
|
1884
1946
|
silentPrint(params: {
|
|
1885
1947
|
unitId: string;
|
|
@@ -1889,6 +1951,14 @@ declare class PdfIoService extends Disposable implements IPdfIoService {
|
|
|
1889
1951
|
}): Promise<ISilentPrintResult>;
|
|
1890
1952
|
saveToHost(context: IPdfSaveContext): Promise<boolean>;
|
|
1891
1953
|
}
|
|
1954
|
+
declare function exportPdfWithTarget(ioService: IPdfIoService, params: IPdfExportUnifiedOptions): Promise<Uint8Array>;
|
|
1955
|
+
declare function exportPdfWithTarget(snapshot: IPdfUnitData, options?: Omit<IPdfExportUnifiedOptions, 'snapshot'> & {
|
|
1956
|
+
ioService?: IPdfIoService;
|
|
1957
|
+
}): Promise<Uint8Array>;
|
|
1958
|
+
declare function exportPdfWithTarget(params: IPdfExportUnifiedOptions & {
|
|
1959
|
+
snapshot: IPdfUnitData;
|
|
1960
|
+
ioService?: IPdfIoService;
|
|
1961
|
+
}): Promise<Uint8Array>;
|
|
1892
1962
|
|
|
1893
1963
|
interface IUniverPdfsConfig {
|
|
1894
1964
|
/** Default physical unit displayed in rulers and inspector (`'mm'` or `'pt'`) */
|
|
@@ -2062,4 +2132,4 @@ declare class PdfSelectionService extends Disposable implements IPdfSelectionSer
|
|
|
2062
2132
|
getVersionSnapshot(unitId: string, versionId: string): IPdfVersionSnapshot | null;
|
|
2063
2133
|
}
|
|
2064
2134
|
|
|
2065
|
-
export { ASPECT_RATIO_LOCKED_BARCODE_TYPES, AddPdfElementCommand, AddPdfElementMutation, AddPdfLayerCommand, AddPdfPageCommand, AddPdfPageMutation, AlignSelectedPdfElementsCommand, type AspectRatioLockedBarcodeType, AssignPdfElementLayerCommand, BARCODE_TYPES, CIRCLE_MARK_BEZIER_KAPPA, DeleteSelectedPdfElementsCommand, DistributeSelectedPdfElementsCommand, DuplicateSelectedPdfElementsCommand, FindAndReplacePdfTextCommand, type IAddPdfElementCommandParams, type IAddPdfLayerCommandParams, type IAssignPdfElementLayerCommandParams, type IBarcodeBarRun, type IBarcodeLayoutBox, type IBeforePdfExportHookParams, type IBeforePdfPrintHookParams, type ICircleMarkBezierEllipse, type IComputeSmartSnapParams, type IConvertImagesToPdfOptions, type IConvertMarkdownToPdfOptions, type IDataMatrixEncodedResult, type IDeleteSelectedPdfElementsCommandParams, type IDistributeSelectedPdfElementsCommandParams, type IDynamicLayoutItemInput, type IDynamicLayoutPlacement, type IDynamicLayoutSplitOptions, type IDynamicLayoutSplitRange, type IFindAndReplacePdfTextCommandParams, type IGs1128EncodedResult, type IGs1DataMatrixEncodedResult, type IHttpSilentPrintAdapterConfig, type IImageFitPlacement, type IImportPdfSourceCommandParams, type IJapanPostBar, type IJapanPostEncodedResult, type ILinear1dEncodedResult, type INw7EncodedResult, type IParsedPdfColor, type IParsedStreamTextOp, type IPdf417EncodedResult, type IPdfAiCopilotAdapter, IPdfAttachment, type IPdfAuditSealOptions, type IPdfAuditVerificationResult, type IPdfBatchAction, type IPdfBatchPipelineFileInput, type IPdfBatchPipelineItemResult, IPdfBatesConfig, IPdfBookmarkItem, type IPdfBrowserFidelitySampleSet, IPdfCircleMarkElement, type IPdfComparisonResult, IPdfCropBox, IPdfDocument, IPdfDocumentData, type IPdfDocxDocumentSnapshot, type IPdfElementDiffItem, type IPdfExportContext, IPdfExportOptions, type IPdfExportedHookParams, type IPdfFormFieldIssue, type IPdfFormValidationResult, IPdfHeaderFooterConfig, type IPdfImportContext, type IPdfImportOutcome, type IPdfImportOutcomeReport, type IPdfImportSourceOptions, type IPdfImportSourceResult, type IPdfImportWarning, type IPdfImportWithReportContext, type IPdfInspectedPageSize, type IPdfIoAdapter, type IPdfIoAdapterImportResult, type IPdfIoCapabilities, type IPdfIoFormatCapability, type IPdfIoFormatListConfig, IPdfIoService, IPdfLayer, IPdfListElement, type IPdfListPageChunk, IPdfNativeTextSpan, type IPdfOcrAdapter, type IPdfOcrFieldInput, type IPdfOcrPageInfo, type IPdfOcrRecognizedBlock, type IPdfOptimizeUnitOptions, type IPdfOrganizeAction, IPdfPage, IPdfPageElement, IPdfPageSize, type IPdfRenderedPageImage, IPdfResourceBinding, IPdfRichTextSpan, type IPdfSanitizeOptions, type IPdfSaveContext, IPdfSecurityPermissions, IPdfSelectionService, type IPdfSelectionState, type IPdfSheetConvertedStructure, type IPdfSheetConvertedTable, IPdfSignatureEnvelope, type IPdfSignedAuditResult, IPdfSignerInfo, IPdfSourceDocumentRef, type IPdfTextDiffItem, IPdfTextElement, IPdfTextStyle, IPdfUnitData, IPdfUnitMetadata, type IPdfUnitPropsPatch, type IPdfUnitSignatureVerificationResult, IPdfVersionSnapshot, type IPdfViewportRatio, IPdfWatermarkConfig, type IPdfWordBlock, type IPdfWordConvertedPage, type IPdfWordConvertedStructure, type IPdfWorkbookCell, type IPdfWorkbookSnapshot, IPdfjsAssetsConfig, type IRemovePdfLayerCommandParams, type IRenderPdfBytesToImagesOptions, type IReplacePdfNativeTextCommandParams, type IRotatePdfPageCommandParams, type ISetPdfAttachmentsCommandParams, type ISetPdfBatesConfigCommandParams, type ISetPdfBookmarksCommandParams, type ISetPdfHeaderFooterConfigCommandParams, type ISetPdfNativeTextSpansCommandParams, type ISetPdfPageCropBoxCommandParams, type ISetPdfWatermarkConfigCommandParams, type ISilentPrintOptions, type ISilentPrintResult, type ISmartSnapBox, type ISnapGuideLine, type ITemplateVariableMatch, type IUnifiedBarcodeEncoded, type IUniverPdfsConfig, type IUpdatePdfElementsCommandParams, type IUpdatePdfLayerCommandParams, type IUpdatePdfPageMutationParams, type IUpdatePdfPagePropsCommandParams, type IUpdatePdfUnitPropsCommandParams, type IUpdatePdfUnitPropsMutationParams, ImportPdfSourceCommand, type JapanPostBarState, PDF_DIFF_COLORS, PDF_PAGE_PRESETS, type PdfAlignMode, PdfBatesPosition, type PdfCanonicalBarcodeType, PdfColorSpaceType, type PdfConvertibleImageInput, PdfDateTimeKind, PdfDisplayUnit, type PdfDistributeDirection, PdfElementType, type PdfExifMatrixTuple, type PdfExifOrientation, PdfImportError, type PdfImportErrorCode, PdfInteractionMode, PdfIoService, type PdfIoTarget, PdfIoTargetError, type PdfLayerOrderMode, PdfPageRotation, type PdfRawImportWarning, PdfSelectionService, PdfUnitModel, RemovePdfElementsMutation, RemovePdfLayerCommand, RemovePdfPageCommand, RemovePdfPageMutation, ReorderPdfElementOrderMutation, ReorderPdfLayerCommand, ReorderPdfPagesCommand, ReorderPdfPagesMutation, ReplacePdfNativeTextCommand, ReplacePdfSnapshotCommand, RestorePdfVersionCommand, RotatePdfPageCommand, SavePdfVersionCommand, SetPdfAttachmentsCommand, SetPdfBatesConfigCommand, SetPdfBookmarksCommand, SetPdfHeaderFooterConfigCommand, SetPdfNativeTextSpansCommand, SetPdfPageCropBoxCommand, SetPdfPageSizeCommand, SetPdfWatermarkConfigCommand, type SignatureQuadraticSegment, type SilentPrintDriverType, type SvgMat2D, UNIVER_PDFS_PLUGIN_NAME, UniverPdfsPlugin, UpdatePdfElementsCommand, UpdatePdfElementsMutation, UpdatePdfLayerCommand, UpdatePdfPageMutation, UpdatePdfPagePropsCommand, UpdatePdfUnitPropsCommand, UpdatePdfUnitPropsMutation, applyOcrToUnitPage, autoDetectFormFieldsOnPage, buildOverlayImportCandidateSnapshot, buildPdfTemplateFromOcrFields, canonicalJsonStringify, cmykToRgb, comparePdfBytes, comparePdfUnits, computeBarcodeLayoutBox, computeCircleMarkBezierEllipse, computeDynamicLayoutSplitRanges, computeElementCenterTransformMatrix, computeExifTransformMatrix, computeExpandedTextHeightMm, computeExpandedTextHeightPt, computeImageFitPlacement, computePasteCascadeOffset, computePdfPayloadDigest, computeSmartSnapWithEqualGap, convertImagesToPdfBytes, convertMarkdownToPdfBytes, convertMarkdownToPdfUnit, convertPdfBytesToCsv, convertPdfBytesToDocxBytes, convertPdfToSheetStructure, convertPdfToWordStructure, convertPdfUnitToCsv, createDefaultElement, createDefaultPdfUnitData, createHttpSilentPrintAdapter, createPdfBrowserFidelitySamples, detectFormFieldsFromPageSpans, drawVectorSvgOnPdfPage, encodeBarcodeByFormat, encodeCodabar, encodeCode128, encodeCode39, encodeDataMatrix, encodeEan13, encodeEan8, encodeGs1128, encodeGs1DataMatrix, encodeItf14, encodeJapanPost, encodeNw7, encodePdf417, encodeQrCodeMatrix, encodeUpcA, encodeUpcE, evaluatePdfFormExpression, evaluateSafeTemplateExpression, exportFormDataToFdf, exportFormDataToXfdf, exportPdfToDocxSnapshot, exportPdfToWorkbookSnapshot, exportSignedPdfWithAuditSeal, extractAttachmentsFromPdfBytes, extractNativeTextSpansFromPdfBytes, formatGs1HumanReadable, formatPdfDateTimeValue, generatePdfTemplateByPrompt, getDefaultDateTimeFormat, getRegisteredOcrAdapter, importAcroFormPdfToUnit, importFormDataFromFdf, importFormDataFromXfdf, importPdfSource, insertPdfPagesBytes, inspectPdfBytePageSizes, isAspectRatioLockedBarcodeType, isCircleMarkChecked, isExifDimensionsSwapped, mayBeJson, mergePdfBytes, movePdfPageBytes, normalizeBarcodeFormatType, normalizePdfImportWarnings, optimizePdfUnit, organizePdfBytes, paginatePdfListItems, parseGs1ApplicationIdentifiers, parseInlineMarkdownToSpans, parseObjectPositionRatios, parsePdfColorWithAlpha, parsePdfContentStreamTextOps, parsePdfPageRange, parseSafeKeyValueRecord, parseSvgToVectorCommands, parseSvgTransformAttr, readJpegExifOrientation, recalculatePdfFormFields, rectsIntersect, registerOcrAdapter, removePdfPagesBytes, renderBarcodeSvgByFormat, renderBarcodeSvgDataUrlByFormat, renderDataMatrixSvg, renderDataMatrixSvgDataUrl, renderGs1128Svg, renderGs1128SvgDataUrl, renderGs1DataMatrixSvg, renderGs1DataMatrixSvgDataUrl, renderPdf417Svg, renderPdf417SvgDataUrl, renderPdfBytesToImages, resolveMultiVariableText, rgbToCmyk, rotatePdfPagesBytes, runPdfBatchPipeline, safeLookupVariablePath, sanitizePdfUnit, scanTemplateExpressionTokens, sha256BytesSync, sha256Hex, sha256HexSync, signPdfUnitWithDigest, exportSignedPdfWithAuditSeal as signPdfWithAuditDigest, smoothSignatureStrokeQuadratic, splitPdfBytes, stripPdfPageNativeTextInRects, svgToDataUri, toHtmlDateTimeInputValue, toPdfLibColor, toggleCircleMarkState, validatePdfFormFields, verifyPdfAuditSeal as verifyPdfAuditDigest, verifyPdfAuditSeal, verifyPdfUnitSignature, visitTemplateVariables, wrapPdfTextLines };
|
|
2135
|
+
export { ASPECT_RATIO_LOCKED_BARCODE_TYPES, AddPdfElementCommand, AddPdfElementMutation, AddPdfLayerCommand, AddPdfPageCommand, AddPdfPageMutation, AlignSelectedPdfElementsCommand, type AspectRatioLockedBarcodeType, AssignPdfElementLayerCommand, BARCODE_TYPES, CIRCLE_MARK_BEZIER_KAPPA, DeleteSelectedPdfElementsCommand, DistributeSelectedPdfElementsCommand, DuplicateSelectedPdfElementsCommand, FindAndReplacePdfTextCommand, type IAddPdfElementCommandParams, type IAddPdfLayerCommandParams, type IAssignPdfElementLayerCommandParams, type IBarcodeBarRun, type IBarcodeLayoutBox, type IBeforePdfExportHookParams, type IBeforePdfPrintHookParams, type ICircleMarkBezierEllipse, type IComputeSmartSnapParams, type IConvertImagesToPdfOptions, type IConvertMarkdownToPdfOptions, type IDataMatrixEncodedResult, type IDeleteSelectedPdfElementsCommandParams, type IDistributeSelectedPdfElementsCommandParams, type IDynamicLayoutItemInput, type IDynamicLayoutPlacement, type IDynamicLayoutSplitOptions, type IDynamicLayoutSplitRange, type IFindAndReplacePdfTextCommandParams, type IGs1128EncodedResult, type IGs1DataMatrixEncodedResult, type IHttpSilentPrintAdapterConfig, type IImageFitPlacement, type IImportPdfSourceCommandParams, type IJapanPostBar, type IJapanPostEncodedResult, type ILinear1dEncodedResult, type INw7EncodedResult, type IParsedPdfColor, type IParsedStreamTextOp, type IPdf417EncodedResult, type IPdfAiCopilotAdapter, IPdfAttachment, type IPdfAuditSealOptions, type IPdfAuditVerificationResult, type IPdfBatchAction, type IPdfBatchPipelineFileInput, type IPdfBatchPipelineItemResult, IPdfBatesConfig, IPdfBookmarkItem, type IPdfBrowserFidelityExpectationEntry, type IPdfBrowserFidelityExpectationSuite, type IPdfBrowserFidelityExpectedOutcome, type IPdfBrowserFidelityRenderScenario, type IPdfBrowserFidelitySampleSet, type IPdfBrowserFidelityStrictErrorExpectation, IPdfCircleMarkElement, type IPdfComparisonResult, IPdfCropBox, IPdfDocument, IPdfDocumentData, type IPdfDocxDocumentSnapshot, type IPdfElementDiffItem, type IPdfExportContext, IPdfExportOptions, type IPdfExportUnifiedOptions, type IPdfExportedHookParams, type IPdfFormFieldIssue, type IPdfFormValidationResult, IPdfHeaderFooterConfig, type IPdfImportContext, type IPdfImportOptions, type IPdfImportOutcome, type IPdfImportOutcomeReport, type IPdfImportSourceOptions, type IPdfImportSourceResult, type IPdfImportWarning, type IPdfImportWithReportContext, type IPdfInspectedPageSize, type IPdfIoAdapter, type IPdfIoAdapterImportResult, type IPdfIoCapabilities, type IPdfIoFormatCapability, type IPdfIoFormatListConfig, IPdfIoService, IPdfLayer, IPdfListElement, type IPdfListPageChunk, IPdfNativeTextSpan, type IPdfOcrAdapter, type IPdfOcrFieldInput, type IPdfOcrPageInfo, type IPdfOcrRecognizedBlock, type IPdfOptimizeUnitOptions, type IPdfOrganizeAction, IPdfPage, IPdfPageElement, IPdfPageSize, type IPdfRenderedPageImage, IPdfResourceBinding, IPdfRichTextSpan, type IPdfSanitizeOptions, type IPdfSaveContext, IPdfSecurityPermissions, IPdfSelectionService, type IPdfSelectionState, type IPdfSheetConvertedStructure, type IPdfSheetConvertedTable, IPdfSignatureEnvelope, type IPdfSignedAuditResult, IPdfSignerInfo, IPdfSourceDocumentRef, type IPdfTextDiffItem, IPdfTextElement, IPdfTextStyle, IPdfUnitData, IPdfUnitMetadata, type IPdfUnitPropsPatch, type IPdfUnitSignatureVerificationResult, IPdfVersionSnapshot, type IPdfViewportRatio, IPdfWatermarkConfig, type IPdfWordBlock, type IPdfWordConvertedPage, type IPdfWordConvertedStructure, type IPdfWorkbookCell, type IPdfWorkbookSnapshot, IPdfjsAssetsConfig, type IRemovePdfLayerCommandParams, type IRenderPdfBytesToImagesOptions, type IReplacePdfNativeTextCommandParams, type IRotatePdfPageCommandParams, type ISetPdfAttachmentsCommandParams, type ISetPdfBatesConfigCommandParams, type ISetPdfBookmarksCommandParams, type ISetPdfHeaderFooterConfigCommandParams, type ISetPdfNativeTextSpansCommandParams, type ISetPdfPageCropBoxCommandParams, type ISetPdfWatermarkConfigCommandParams, type ISilentPrintOptions, type ISilentPrintResult, type ISmartSnapBox, type ISnapGuideLine, type ITemplateVariableMatch, type IUnifiedBarcodeEncoded, type IUniverPdfsConfig, type IUpdatePdfElementsCommandParams, type IUpdatePdfLayerCommandParams, type IUpdatePdfPageMutationParams, type IUpdatePdfPagePropsCommandParams, type IUpdatePdfUnitPropsCommandParams, type IUpdatePdfUnitPropsMutationParams, ImportPdfSourceCommand, type JapanPostBarState, PDF_DIFF_COLORS, PDF_PAGE_PRESETS, PDF_S1_S7_FIDELITY_EXPECTATIONS, type PdfAlignMode, PdfBatesPosition, type PdfBrowserFidelitySampleKey, type PdfCanonicalBarcodeType, PdfColorSpaceType, type PdfConvertibleImageInput, PdfDateTimeKind, PdfDisplayUnit, type PdfDistributeDirection, PdfElementType, type PdfExifMatrixTuple, type PdfExifOrientation, PdfImportError, type PdfImportErrorCode, PdfInteractionMode, PdfIoService, type PdfIoTarget, PdfIoTargetError, type PdfLayerOrderMode, PdfPageRotation, type PdfRawImportWarning, PdfSelectionService, PdfUnitModel, RemovePdfElementsMutation, RemovePdfLayerCommand, RemovePdfPageCommand, RemovePdfPageMutation, ReorderPdfElementOrderMutation, ReorderPdfLayerCommand, ReorderPdfPagesCommand, ReorderPdfPagesMutation, ReplacePdfNativeTextCommand, ReplacePdfSnapshotCommand, RestorePdfVersionCommand, RotatePdfPageCommand, SavePdfVersionCommand, SetPdfAttachmentsCommand, SetPdfBatesConfigCommand, SetPdfBookmarksCommand, SetPdfHeaderFooterConfigCommand, SetPdfNativeTextSpansCommand, SetPdfPageCropBoxCommand, SetPdfPageSizeCommand, SetPdfWatermarkConfigCommand, type SignatureQuadraticSegment, type SilentPrintDriverType, type SvgMat2D, UNIVER_PDFS_PLUGIN_NAME, UniverPdfsPlugin, UpdatePdfElementsCommand, UpdatePdfElementsMutation, UpdatePdfLayerCommand, UpdatePdfPageMutation, UpdatePdfPagePropsCommand, UpdatePdfUnitPropsCommand, UpdatePdfUnitPropsMutation, applyOcrToUnitPage, autoDetectFormFieldsOnPage, buildOverlayImportCandidateSnapshot, buildPdfTemplateFromOcrFields, canonicalJsonStringify, cmykToRgb, comparePdfBytes, comparePdfUnits, computeBarcodeLayoutBox, computeCircleMarkBezierEllipse, computeDynamicLayoutSplitRanges, computeElementCenterTransformMatrix, computeExifTransformMatrix, computeExpandedTextHeightMm, computeExpandedTextHeightPt, computeImageFitPlacement, computePasteCascadeOffset, computePdfPayloadDigest, computeSmartSnapWithEqualGap, convertImagesToPdfBytes, convertMarkdownToPdfBytes, convertMarkdownToPdfUnit, convertPdfBytesToCsv, convertPdfBytesToDocxBytes, convertPdfToSheetStructure, convertPdfToWordStructure, convertPdfUnitToCsv, createDefaultElement, createDefaultPdfUnitData, createHttpSilentPrintAdapter, createPdfAbortError, createPdfBrowserFidelityExpectations, createPdfBrowserFidelitySamples, detectFormFieldsFromPageSpans, drawVectorSvgOnPdfPage, encodeBarcodeByFormat, encodeCodabar, encodeCode128, encodeCode39, encodeDataMatrix, encodeEan13, encodeEan8, encodeGs1128, encodeGs1DataMatrix, encodeItf14, encodeJapanPost, encodeNw7, encodePdf417, encodeQrCodeMatrix, encodeUpcA, encodeUpcE, evaluatePdfFormExpression, evaluateSafeTemplateExpression, exportFormDataToFdf, exportFormDataToXfdf, exportPdfToDocxSnapshot, exportPdfToWorkbookSnapshot, exportPdfWithTarget, exportSignedPdfWithAuditSeal, extractAttachmentsFromPdfBytes, extractNativeTextSpansFromPdfBytes, formatGs1HumanReadable, formatPdfDateTimeValue, generatePdfTemplateByPrompt, getDefaultDateTimeFormat, getRegisteredOcrAdapter, importAcroFormPdfToUnit, importFormDataFromFdf, importFormDataFromXfdf, importPdfSource, insertPdfPagesBytes, inspectPdfBytePageSizes, isAspectRatioLockedBarcodeType, isCircleMarkChecked, isExifDimensionsSwapped, mayBeJson, mergePdfBytes, movePdfPageBytes, normalizeBarcodeFormatType, normalizePdfImportWarnings, optimizePdfUnit, organizePdfBytes, paginatePdfListItems, parseGs1ApplicationIdentifiers, parseInlineMarkdownToSpans, parseObjectPositionRatios, parsePdfColorWithAlpha, parsePdfContentStreamTextOps, parsePdfPageRange, parseSafeKeyValueRecord, parseSvgToVectorCommands, parseSvgTransformAttr, readJpegExifOrientation, recalculatePdfFormFields, rectsIntersect, registerOcrAdapter, removePdfPagesBytes, renderBarcodeSvgByFormat, renderBarcodeSvgDataUrlByFormat, renderDataMatrixSvg, renderDataMatrixSvgDataUrl, renderGs1128Svg, renderGs1128SvgDataUrl, renderGs1DataMatrixSvg, renderGs1DataMatrixSvgDataUrl, renderPdf417Svg, renderPdf417SvgDataUrl, renderPdfBytesToImages, resolveMultiVariableText, rgbToCmyk, rotatePdfPagesBytes, runPdfBatchPipeline, safeLookupVariablePath, sanitizePdfUnit, scanTemplateExpressionTokens, sha256BytesSync, sha256Hex, sha256HexSync, signPdfUnitWithDigest, exportSignedPdfWithAuditSeal as signPdfWithAuditDigest, smoothSignatureStrokeQuadratic, splitPdfBytes, stripPdfPageNativeTextInRects, svgToDataUri, toHtmlDateTimeInputValue, toPdfLibColor, toggleCircleMarkState, validatePdfFormFields, verifyPdfAuditSeal as verifyPdfAuditDigest, verifyPdfAuditSeal, verifyPdfUnitSignature, visitTemplateVariables, wrapPdfTextLines };
|
package/lib/types/jsx/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as IJsxAbsoluteProps, aJ as IPdfJsxNode, X as IJsxBarcodeProps, Y as IJsxBoxProps, _ as IJsxDocumentProps, a8 as IJsxShapeProps, $ as IJsxHeaderFooterProps, a0 as IJsxImageProps, a1 as IJsxLineProps, a2 as IJsxListProps, a3 as IJsxMultiVariableTextProps, a5 as IJsxPageProps, a4 as IJsxPageBreakProps, a6 as IJsxQrCodeProps, a7 as IJsxRowProps, a9 as IJsxSpacerProps, aa as IJsxStackProps, ab as IJsxStaticProps, ac as IJsxSvgProps, ae as IJsxTableProps, af as IJsxTextProps,
|
|
2
|
-
export { N as Fragment, Z as IJsxContainerStyleProps, ad as IJsxTableColumnSpec, bh as JSX, bj as PDF_JSX_ELEMENT_SYMBOL, bk as PDF_JSX_FRAGMENT_SYMBOL,
|
|
1
|
+
import { W as IJsxAbsoluteProps, aJ as IPdfJsxNode, X as IJsxBarcodeProps, Y as IJsxBoxProps, _ as IJsxDocumentProps, a8 as IJsxShapeProps, $ as IJsxHeaderFooterProps, a0 as IJsxImageProps, a1 as IJsxLineProps, a2 as IJsxListProps, a3 as IJsxMultiVariableTextProps, a5 as IJsxPageProps, a4 as IJsxPageBreakProps, a6 as IJsxQrCodeProps, a7 as IJsxRowProps, a9 as IJsxSpacerProps, aa as IJsxStackProps, ab as IJsxStaticProps, ac as IJsxSvgProps, ae as IJsxTableProps, af as IJsxTextProps, bx as PdfJsxComponent, U as IExportJsxToPdfOptions, bc as IRenderJsxOptions, I as IPdfUnitData, bb as IPdfmeTemplate } from '../jsx-dev-runtime-Dm72R_Vm.js';
|
|
2
|
+
export { N as Fragment, Z as IJsxContainerStyleProps, ad as IJsxTableColumnSpec, bh as JSX, bj as PDF_JSX_ELEMENT_SYMBOL, bk as PDF_JSX_FRAGMENT_SYMBOL, bw as PdfJsxChild, by as PdfJsxIntrinsicKind, bz as PdfJsxPaddingSpec, bZ as createPdfJsxNode, c3 as evaluatePdfJsxElement, c9 as extractJsxTextContent, cc as flattenJsxChildrenToNodes, cl as isPdfJsxNode, cm as jsx, cn as jsxDEV, co as jsxs, cy as resolvePaddingMm } from '../jsx-dev-runtime-Dm72R_Vm.js';
|
|
3
3
|
import '@univerjs/core';
|
|
4
4
|
|
|
5
5
|
declare function Document(props?: IJsxDocumentProps): IPdfJsxNode<IJsxDocumentProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { N as Fragment, bh as JSX,
|
|
1
|
+
export { N as Fragment, bh as JSX, cm as jsx, cn as jsxDEV, co as jsxs } from '../jsx-dev-runtime-Dm72R_Vm.js';
|
|
2
2
|
import '@univerjs/core';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { N as Fragment, bh as JSX,
|
|
1
|
+
export { N as Fragment, bh as JSX, cm as jsx, cn as jsxDEV, co as jsxs } from '../jsx-dev-runtime-Dm72R_Vm.js';
|
|
2
2
|
import '@univerjs/core';
|
|
@@ -1082,6 +1082,7 @@ type PdfFontFallbackPolicy = 'error' | 'raster-hd' | 'cid-vector';
|
|
|
1082
1082
|
type PdfMissingGlyphPolicy = 'error' | 'warn';
|
|
1083
1083
|
type PdfTablePaginationMode = 'auto' | 'none';
|
|
1084
1084
|
type PdfZebraParityMode = 'continuous' | 'chunk';
|
|
1085
|
+
type PdfFontFailureKind = 'network' | 'http' | 'integrity' | 'format' | 'empty';
|
|
1085
1086
|
interface IPdfFontSource {
|
|
1086
1087
|
/** Optional font family label (used in diagnostics and optional family matching) */
|
|
1087
1088
|
family?: string;
|
|
@@ -1093,12 +1094,18 @@ interface IPdfFontSource {
|
|
|
1093
1094
|
url?: string;
|
|
1094
1095
|
/** Optional SRI digest ('sha256-...', 'sha384-...', or 'sha512-...') verified before parsing */
|
|
1095
1096
|
integrity?: string;
|
|
1097
|
+
/** Optional fetch credentials mode ('omit' | 'same-origin' | 'include') forwarded when fetching `url` */
|
|
1098
|
+
credentials?: RequestCredentials;
|
|
1099
|
+
/** Optional custom `fetch` init options (e.g. auth headers, mode, cache) merged when fetching `url` */
|
|
1100
|
+
fetchInit?: RequestInit;
|
|
1096
1101
|
}
|
|
1097
1102
|
interface IPdfFailedFontEntry {
|
|
1098
1103
|
index: number;
|
|
1099
1104
|
family?: string;
|
|
1100
1105
|
weight?: 'normal' | 'bold';
|
|
1101
1106
|
url?: string;
|
|
1107
|
+
kind: PdfFontFailureKind;
|
|
1108
|
+
status?: number;
|
|
1102
1109
|
reason: string;
|
|
1103
1110
|
}
|
|
1104
1111
|
interface IPdfRenderWarning {
|
|
@@ -1186,6 +1193,10 @@ interface IPdfCjkFontSourcesOptions {
|
|
|
1186
1193
|
* - `{ normal?: string; bold?: string }`: attaches custom integrity hashes per weight
|
|
1187
1194
|
*/
|
|
1188
1195
|
integrity?: boolean | Partial<Record<'normal' | 'bold', string>>;
|
|
1196
|
+
/** Optional `RequestCredentials` forwarded to each generated `IPdfFontSource` for authenticated endpoints */
|
|
1197
|
+
credentials?: RequestCredentials;
|
|
1198
|
+
/** Optional `RequestInit` forwarded to each generated `IPdfFontSource` for custom headers/options */
|
|
1199
|
+
fetchInit?: RequestInit;
|
|
1189
1200
|
}
|
|
1190
1201
|
/**
|
|
1191
1202
|
* Pure helper generating standard `render.fonts` (`IPdfFontSource[]`) entries for the standalone
|
|
@@ -1193,6 +1204,7 @@ interface IPdfCjkFontSourcesOptions {
|
|
|
1193
1204
|
* Performs zero network I/O until passed to `exportPdfBytes` / `encodePdf` / `mountPdf`.
|
|
1194
1205
|
*/
|
|
1195
1206
|
declare function createPdfCjkFontSources(options?: IPdfCjkFontSourcesOptions): IPdfFontSource[];
|
|
1207
|
+
declare function computeFontUrlCacheKey(url: string, integrity?: string): string;
|
|
1196
1208
|
declare function clearPdfFontUrlCache(): void;
|
|
1197
1209
|
interface IDiagnosticGridOverlayOptions {
|
|
1198
1210
|
/** Minor grid step in millimeters (default `5`) */
|
|
@@ -1244,6 +1256,8 @@ interface IPdfExportOptions {
|
|
|
1244
1256
|
accessibilityTagged?: boolean;
|
|
1245
1257
|
/** Compresses uncompressed streams with FlateDecode & prunes unreferenced indirect objects */
|
|
1246
1258
|
optimizeSize?: boolean;
|
|
1259
|
+
/** Optional `AbortSignal` to cancel PDF compilation before or during async rendering */
|
|
1260
|
+
signal?: AbortSignal;
|
|
1247
1261
|
}
|
|
1248
1262
|
declare function resolveTemplateString(raw: string, bindingField?: string, data?: Record<string, unknown>, pageMeta?: {
|
|
1249
1263
|
pageNumber: number;
|
|
@@ -1717,4 +1731,4 @@ declare namespace JSX {
|
|
|
1717
1731
|
}
|
|
1718
1732
|
}
|
|
1719
1733
|
|
|
1720
|
-
export { type IJsxHeaderFooterProps 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, DEFAULT_PDF_CJK_FONT_FAMILY as J, DEFAULT_PDF_CJK_FONT_FILES as K, DEFAULT_PDF_CJK_FONT_PACKAGE as L, DEFAULT_PDF_CJK_FONT_VERSION as M, Fragment as N, type ICjkDetectionSummary as O, PdfElementType as P, type IComputeDynamicFontSizeParams as Q, type IDetectedPaperPreset as R, type IDiagnosePdfFontsOptions as S, type IDiagnosticGridOverlayOptions as T, type IExportJsxToPdfOptions as U, type IInputsCjkReport as V, type IJsxAbsoluteProps as W, type IJsxBarcodeProps as X, type IJsxBoxProps as Y, type IJsxContainerStyleProps as Z, type IJsxDocumentProps as _, type IPdfDocument as a, type IPdfTableCellStyle as a$, type IJsxImageProps as a0, type IJsxLineProps as a1, type IJsxListProps as a2, type IJsxMultiVariableTextProps as a3, type IJsxPageBreakProps as a4, type IJsxPageProps as a5, type IJsxQrCodeProps as a6, type IJsxRowProps as a7, type IJsxShapeProps as a8, type IJsxSpacerProps as a9, type IPdfFontDiagnosticIssue as aA, type IPdfFontDoctorInputEntry as aB, type IPdfFontSource as aC, type IPdfImageCrop as aD, type IPdfImageElement as aE, type IPdfInkElement as aF, type IPdfInkPoint as aG, type IPdfInputContractValidationResult as aH, type IPdfInputContractViolation as aI, type IPdfJsxNode as aJ, type IPdfLineElement as aK, type IPdfMissingGlyphItem as aL, type IPdfPageElementBase as aM, type IPdfParagraphBlock as aN, type IPdfPolygonElement as aO, type IPdfPolygonPoint as aP, type IPdfQrCodeElement as aQ, type IPdfRadioGroupElement as aR, type IPdfRedactionElement as aS, type IPdfRenderWarning as aT, type IPdfSchemaDiagnosticIssue as aU, type IPdfSelectElement as aV, type IPdfShapeElement as aW, type IPdfSignatureElement as aX, type IPdfStampElement as aY, type IPdfSvgElement as aZ, type IPdfTableBorderWidths as a_, type IJsxStackProps as aa, type IJsxStaticProps as ab, type IJsxSvgProps as ac, type IJsxTableColumnSpec as ad, type IJsxTableProps as ae, type IJsxTextProps as af, type IPdfAnnotationElement as ag, type IPdfAnnotationReply as ah, type IPdfBarcodeElement as ai, type IPdfBrowserRenderOptions as aj, type IPdfCheckboxElement as ak, type IPdfCjkFontSourcesOptions as al, type IPdfDatasetField as am, type IPdfDatasetSchema as an, type IPdfDateTimeElement as ao, type IPdfDocumentMetadata as ap, type IPdfDurableEditState as aq, type IPdfDynamicFontSizeConfig as ar, type IPdfElement as as, type IPdfElementBase as at, type IPdfElementTransform as au, type IPdfEllipseElement as av, type IPdfExportCapabilitiesReport as aw, type IPdfFailedFontEntry as ax, type IPdfFieldContractHint as ay, type IPdfFontDiagnosisReport as az, type IPdfPage as b,
|
|
1734
|
+
export { type IJsxHeaderFooterProps 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, DEFAULT_PDF_CJK_FONT_FAMILY as J, DEFAULT_PDF_CJK_FONT_FILES as K, DEFAULT_PDF_CJK_FONT_PACKAGE as L, DEFAULT_PDF_CJK_FONT_VERSION as M, Fragment as N, type ICjkDetectionSummary as O, PdfElementType as P, type IComputeDynamicFontSizeParams as Q, type IDetectedPaperPreset as R, type IDiagnosePdfFontsOptions as S, type IDiagnosticGridOverlayOptions as T, type IExportJsxToPdfOptions as U, type IInputsCjkReport as V, type IJsxAbsoluteProps as W, type IJsxBarcodeProps as X, type IJsxBoxProps as Y, type IJsxContainerStyleProps as Z, type IJsxDocumentProps as _, type IPdfDocument as a, type IPdfTableCellStyle as a$, type IJsxImageProps as a0, type IJsxLineProps as a1, type IJsxListProps as a2, type IJsxMultiVariableTextProps as a3, type IJsxPageBreakProps as a4, type IJsxPageProps as a5, type IJsxQrCodeProps as a6, type IJsxRowProps as a7, type IJsxShapeProps as a8, type IJsxSpacerProps as a9, type IPdfFontDiagnosticIssue as aA, type IPdfFontDoctorInputEntry as aB, type IPdfFontSource as aC, type IPdfImageCrop as aD, type IPdfImageElement as aE, type IPdfInkElement as aF, type IPdfInkPoint as aG, type IPdfInputContractValidationResult as aH, type IPdfInputContractViolation as aI, type IPdfJsxNode as aJ, type IPdfLineElement as aK, type IPdfMissingGlyphItem as aL, type IPdfPageElementBase as aM, type IPdfParagraphBlock as aN, type IPdfPolygonElement as aO, type IPdfPolygonPoint as aP, type IPdfQrCodeElement as aQ, type IPdfRadioGroupElement as aR, type IPdfRedactionElement as aS, type IPdfRenderWarning as aT, type IPdfSchemaDiagnosticIssue as aU, type IPdfSelectElement as aV, type IPdfShapeElement as aW, type IPdfSignatureElement as aX, type IPdfStampElement as aY, type IPdfSvgElement as aZ, type IPdfTableBorderWidths as a_, type IJsxStackProps as aa, type IJsxStaticProps as ab, type IJsxSvgProps as ac, type IJsxTableColumnSpec as ad, type IJsxTableProps as ae, type IJsxTextProps as af, type IPdfAnnotationElement as ag, type IPdfAnnotationReply as ah, type IPdfBarcodeElement as ai, type IPdfBrowserRenderOptions as aj, type IPdfCheckboxElement as ak, type IPdfCjkFontSourcesOptions as al, type IPdfDatasetField as am, type IPdfDatasetSchema as an, type IPdfDateTimeElement as ao, type IPdfDocumentMetadata as ap, type IPdfDurableEditState as aq, type IPdfDynamicFontSizeConfig as ar, type IPdfElement as as, type IPdfElementBase as at, type IPdfElementTransform as au, type IPdfEllipseElement as av, type IPdfExportCapabilitiesReport as aw, type IPdfFailedFontEntry as ax, type IPdfFieldContractHint as ay, type IPdfFontDiagnosisReport as az, type IPdfPage as b, detectCJKInPdfInputs as b$, type IPdfTableColumn as b0, type IPdfTableElement as b1, type IPdfTableMerge as b2, type IPdfTablePageChunk as b3, type IPdfTablePaginationOptions as b4, type IPdfTableRowCapacity as b5, type IPdfTableThemePreset as b6, type IPdfTemplateSchemaValidationResult as b7, type IPdfVariableValidationResult as b8, type IPdfmeBlankPdf as b9, PdfListKind as bA, PdfListPresetId as bB, type PdfMissingGlyphPolicy as bC, type PdfPaperPresetName as bD, PdfRenderError as bE, PdfTableBorderStyle as bF, PdfTableCellVerticalAlign as bG, type PdfTablePaginationMode as bH, PdfTextAnchor as bI, type PdfTextFormatMode as bJ, type PdfTextOverflowMode as bK, type PdfZebraParityMode as bL, UNIVER_PDF_SCHEMA as bM, UNIVER_PDF_SCHEMA_VERSION as bN, buildMinimalTestTrueTypeFont as bO, calculatePdfTableRowCapacity as bP, clearPdfFontUrlCache as bQ, collectMissingGlyphsFromPdfUnit as bR, collectPdfInputContractHints as bS, collectUsedCodePointsFromPdfUnit as bT, computeAutoFitFontSize as bU, computeDynamicFontSize as bV, computeFontUrlCacheKey as bW, computePdfTableSummaryRow as bX, createPdfCjkFontSources as bY, createPdfJsxNode as bZ, detectCJKCharacters as b_, type IPdfmeSchemaItem as ba, type IPdfmeTemplate as bb, type IRenderJsxOptions as bc, type ISubsetFontResult as bd, type ITemplateCjkReport as be, type ITrueTypeFontInspection as bf, type IValidatePdfTemplateSchemaOptions as bg, JSX as bh, PAGE_SIZE_PRESETS_MM as bi, PDF_JSX_ELEMENT_SYMBOL as bj, PDF_JSX_FRAGMENT_SYMBOL as bk, PDF_TABLE_THEME_PRESETS as bl, PT_PER_MM as bm, type PdfAnnotationStatus as bn, PdfAnnotationType as bo, type PdfBarcodeFormat as bp, type PdfCjkScriptBlock as bq, type PdfCjkTextMode as br, type PdfDynamicFontFitMode as bs, type PdfFontFailureKind as bt, type PdfFontFallbackPolicy as bu, PdfImageSourceType as bv, type PdfJsxChild as bw, type PdfJsxComponent as bx, type PdfJsxIntrinsicKind as by, type PdfJsxPaddingSpec as bz, type IPdfPageSize as c, detectCJKInPdfTemplate as c0, detectPaperSizePreset as c1, diagnosePdfFonts as c2, evaluatePdfJsxElement as c3, exportBatchPdfBytes as c4, exportCalibrationGridPdfBytes as c5, exportPdfBytes as c6, exportToPdfmeTemplate as c7, extractAcroFormValuesFromPdfBytes as c8, extractJsxTextContent as c9, resolvePolygonNormalizedPoints as cA, resolveTemplateString as cB, subsetTrueTypeFont as cC, toPdfmeTemplate as cD, validatePdfInputContract as cE, validatePdfTemplateSchema as cF, validatePdfTemplateVariables as cG, wrapMixedCjkAndLatinLines as cH, extractPdfFormValues as ca, fillPdfFormValues as cb, flattenJsxChildrenToNodes as cc, formatBatesNumber as cd, formatPdfTableCell as ce, fromPdfmeTemplate as cf, getTrueTypeMappedCodePoints as cg, importFromPdfmeTemplate as ch, inspectPdfExportCapabilities as ci, inspectTrueTypeFont as cj, isFontUrlSafeToFetch as ck, isPdfJsxNode as cl, jsx as cm, jsxDEV as cn, jsxs as co, mmToPt as cp, normalizeBarcodePayloadForFormat as cq, normalizeImageCrop as cr, overlayDiagnosticGridOnPdfBytes as cs, paginatePdfTableRows as ct, ptToMm as cu, renderBarcodeDataUrl as cv, renderQrCodeDataUrl as cw, resolveDynamicTableRawRows as cx, resolvePaddingMm as cy, resolvePageSizeMm as cz, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yudaocode/univer-pdfs",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.217",
|
|
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",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"lib",
|
|
30
|
+
"fixtures",
|
|
30
31
|
"PDF_BROWSER_RENDERING_CONTRACT.md"
|
|
31
32
|
],
|
|
32
33
|
"main": "./lib/cjs/index.js",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"import": "./lib/es/jsx/jsx-dev-runtime.js",
|
|
69
70
|
"require": "./lib/cjs/jsx/jsx-dev-runtime.js"
|
|
70
71
|
},
|
|
72
|
+
"./fixtures/pdf-s1-s7-fidelity-v1.json": "./fixtures/pdf-s1-s7-fidelity-v1.json",
|
|
71
73
|
"./package.json": "./package.json"
|
|
72
74
|
},
|
|
73
75
|
"dependencies": {
|