@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/cjs/facade/index.js
CHANGED
|
@@ -2526,20 +2526,27 @@ var FPdf = class {
|
|
|
2526
2526
|
return this._injector.get(import_univer_pdfs4.IPdfIoService).getIoCapabilities();
|
|
2527
2527
|
}
|
|
2528
2528
|
async importPdfFile(file, options) {
|
|
2529
|
+
if (options?.signal?.aborted) {
|
|
2530
|
+
throw (0, import_univer_pdfs4.createPdfAbortError)(options.signal);
|
|
2531
|
+
}
|
|
2529
2532
|
const ioService = this._injector.get(import_univer_pdfs4.IPdfIoService);
|
|
2530
2533
|
const outcome = await ioService.importPdf(file, {
|
|
2531
2534
|
unitId: this.getId(),
|
|
2532
2535
|
snapshot: this.save(),
|
|
2533
|
-
target: options?.target
|
|
2536
|
+
target: options?.target,
|
|
2537
|
+
password: options?.password,
|
|
2538
|
+
signal: options?.signal
|
|
2534
2539
|
});
|
|
2535
|
-
if (
|
|
2536
|
-
|
|
2537
|
-
}
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2540
|
+
if (options?.signal?.aborted) {
|
|
2541
|
+
throw (0, import_univer_pdfs4.createPdfAbortError)(options.signal);
|
|
2542
|
+
}
|
|
2543
|
+
const applied = outcome.mode === "snapshot" ? this.loadSnapshot(outcome.snapshot) : this._commandService.syncExecuteCommand(import_univer_pdfs4.ImportPdfSourceCommand.id, {
|
|
2544
|
+
unitId: this.getId(),
|
|
2545
|
+
sourceDocumentRef: outcome.sourceDocumentRef,
|
|
2546
|
+
pageSizes: outcome.pageSizes
|
|
2547
|
+
});
|
|
2548
|
+
if (!applied) {
|
|
2549
|
+
throw new Error(`[UniverPdfs] Failed to apply imported PDF outcome onto unit "${this.getId()}".`);
|
|
2543
2550
|
}
|
|
2544
2551
|
return outcome;
|
|
2545
2552
|
}
|
|
@@ -2553,7 +2560,8 @@ var FPdf = class {
|
|
|
2553
2560
|
snapshot: this.save(),
|
|
2554
2561
|
data,
|
|
2555
2562
|
options,
|
|
2556
|
-
target: options?.target
|
|
2563
|
+
target: options?.target,
|
|
2564
|
+
signal: options?.signal
|
|
2557
2565
|
});
|
|
2558
2566
|
}
|
|
2559
2567
|
/**
|