@embedpdf/engine-core 3.0.0-next.15 → 3.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AnnotationList-CkijRHet.d.cts → AnnotationList-DcyhF2kU.d.cts} +1836 -1308
- package/dist/{AnnotationList-CkijRHet.d.ts → AnnotationList-DcyhF2kU.d.ts} +1836 -1308
- package/dist/{Change-CjImsrN0.cjs → Change-Ct-dB8D5.cjs} +115 -2
- package/dist/Change-Ct-dB8D5.cjs.map +1 -0
- package/dist/{Change-CKoxfTNY.js → Change-tMR34hTU.js} +92 -3
- package/dist/Change-tMR34hTU.js.map +1 -0
- package/dist/{DocumentRenderService-BfFdFSwI.cjs → DocumentRenderService-9IjSQEIU.cjs} +2 -1
- package/dist/{DocumentRenderService-BfFdFSwI.cjs.map → DocumentRenderService-9IjSQEIU.cjs.map} +1 -1
- package/dist/{DocumentRenderService-DV3J9lMz.js → DocumentRenderService-DFrZ9wfW.js} +2 -1
- package/dist/{DocumentRenderService-DV3J9lMz.js.map → DocumentRenderService-DFrZ9wfW.js.map} +1 -1
- package/dist/{DocumentSecurityService-e6vp2de8.d.cts → DocumentSecurityService-D2zA4NKi.d.cts} +2 -2
- package/dist/{DocumentSecurityService-CU1M6Q7m.d.ts → DocumentSecurityService-YJV9df8P.d.ts} +2 -2
- package/dist/{LocalEngine-DFoBm4B3.d.cts → LocalEngine-DBt2-GWF.d.ts} +102 -18
- package/dist/{LocalEngine-DPriFujS.d.ts → LocalEngine-IA9zh3Jh.d.cts} +102 -18
- package/dist/{authority-DLMNR7ff.cjs → authority-BFp6XM04.cjs} +373 -52
- package/dist/authority-BFp6XM04.cjs.map +1 -0
- package/dist/{authority-B3BklsB4.js → authority-PuxpGFhJ.js} +320 -53
- package/dist/authority-PuxpGFhJ.js.map +1 -0
- package/dist/{builders-CNj0POeY.js → builders-DV62HA3I.js} +6 -2
- package/dist/builders-DV62HA3I.js.map +1 -0
- package/dist/{builders-Cgdp_YCn.cjs → builders-DgTAj_tP.cjs} +6 -2
- package/dist/builders-DgTAj_tP.cjs.map +1 -0
- package/dist/{calibrate-DJBXnhLE.cjs → calibrate-DJbi1wuK.cjs} +118 -25
- package/dist/calibrate-DJbi1wuK.cjs.map +1 -0
- package/dist/{calibrate-7T3fnP8-.js → calibrate-nQFgCuki.js} +83 -26
- package/dist/calibrate-nQFgCuki.js.map +1 -0
- package/dist/charmap-Cprti1ta.js.map +1 -1
- package/dist/charmap-aYlefQP9.cjs.map +1 -1
- package/dist/conformance.cjs +1744 -75
- package/dist/conformance.cjs.map +1 -1
- package/dist/conformance.d.cts +105 -10
- package/dist/conformance.d.ts +105 -10
- package/dist/conformance.js +1738 -76
- package/dist/conformance.js.map +1 -1
- package/dist/index.cjs +25 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/public.cjs +6 -4
- package/dist/public.d.cts +5 -5
- package/dist/public.d.ts +5 -5
- package/dist/public.js +5 -5
- package/dist/{resolver-CzxmD9Ck.js → resolver-BBggAxQc.js} +6 -3
- package/dist/resolver-BBggAxQc.js.map +1 -0
- package/dist/{resolver-D2OCtE8F.cjs → resolver-BWSWSF6R.cjs} +6 -3
- package/dist/resolver-BWSWSF6R.cjs.map +1 -0
- package/dist/{runtime-Cl0v56mm.d.ts → runtime-BaDKjxiu.d.ts} +67 -140
- package/dist/{runtime-p1WDzDo4.d.cts → runtime-CWEuiwbk.d.cts} +67 -140
- package/dist/runtime.cjs +267 -7
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +5 -5
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +246 -8
- package/dist/runtime.js.map +1 -1
- package/dist/{schema-DzlUNk38.js → schema-6S2VmlAj.js} +8 -2
- package/dist/schema-6S2VmlAj.js.map +1 -0
- package/dist/{schema-C-gU4vj7.cjs → schema-miH6tWQC.cjs} +13 -1
- package/dist/schema-miH6tWQC.cjs.map +1 -0
- package/dist/{schemas-D6xOGjqg.js → schemas-BE2QGOit.js} +256 -59
- package/dist/schemas-BE2QGOit.js.map +1 -0
- package/dist/{schemas-Berf1swF.cjs → schemas-DljJR9ut.cjs} +397 -80
- package/dist/schemas-DljJR9ut.cjs.map +1 -0
- package/dist/validation.cjs +1 -1
- package/dist/validation.d.cts +1 -1
- package/dist/validation.d.ts +1 -1
- package/dist/validation.js +1 -1
- package/dist/{viewport-DlL5Bxbg.cjs → viewport-CHG9qQUb.cjs} +2 -2
- package/dist/{viewport-DlL5Bxbg.cjs.map → viewport-CHG9qQUb.cjs.map} +1 -1
- package/dist/{viewport-BJW13EGZ.js → viewport-DQR5LyX3.js} +2 -2
- package/dist/{viewport-BJW13EGZ.js.map → viewport-DQR5LyX3.js.map} +1 -1
- package/dist/wire.cjs +225 -57
- package/dist/wire.cjs.map +1 -1
- package/dist/wire.d.cts +3548 -1151
- package/dist/wire.d.ts +3548 -1151
- package/dist/wire.js +198 -53
- package/dist/wire.js.map +1 -1
- package/package.json +1 -1
- package/dist/Change-CKoxfTNY.js.map +0 -1
- package/dist/Change-CjImsrN0.cjs.map +0 -1
- package/dist/authority-B3BklsB4.js.map +0 -1
- package/dist/authority-DLMNR7ff.cjs.map +0 -1
- package/dist/builders-CNj0POeY.js.map +0 -1
- package/dist/builders-Cgdp_YCn.cjs.map +0 -1
- package/dist/calibrate-7T3fnP8-.js.map +0 -1
- package/dist/calibrate-DJBXnhLE.cjs.map +0 -1
- package/dist/resolver-CzxmD9Ck.js.map +0 -1
- package/dist/resolver-D2OCtE8F.cjs.map +0 -1
- package/dist/schema-C-gU4vj7.cjs.map +0 -1
- package/dist/schema-DzlUNk38.js.map +0 -1
- package/dist/schemas-Berf1swF.cjs.map +0 -1
- package/dist/schemas-D6xOGjqg.js.map +0 -1
|
@@ -1,13 +1,70 @@
|
|
|
1
1
|
import { $ as ANNOTATION_FIELD_SPACES_BY_NAME, A as shapeFieldsOf, G as assertRowResources, H as assertKnownFields, J as isBundlePageRef, O as DRAWN_RECT_KINDS, P as semanticEqual, Q as ANNOTATION_FIELD_SPACES, U as assertResourceIds, V as assertBundlePages, W as assertResourcesNamed, Y as isRecord, _t as pdfQuadBounds, dt as pdfPointsBounds, ft as pdfTurnOfDrawn, j as UNBAKED_KINDS, k as pdfShapeForRect, l as pdfResolveRectCommand, lt as pdfPointTurned, mt as isSamePdfRect, n as pdfPredictAnnotationDraft, nt as kindFactsOf, o as pdfPredictAnnotationPatch, ot as DEFAULT_RICH_TEXT_BODY, pt as pdfTurnOfUpright, q as invalidBundle, tt as ANNOTATION_RESOURCE_ROLES, ut as pdfPointUnturned, v as assertWritableMeasure, wt as pdfRectTurnedBounds } from "./resolveAnnotationDraft-CUpf0SMh.js";
|
|
2
2
|
import { h as EngineError, u as encodePageKey, v as _defineProperty, y as EngineErrorCode } from "./format-Dgg428Kb.js";
|
|
3
3
|
import { c as toBase64, o as decodedLengthOf, s as fromBase64 } from "./charmap-Cprti1ta.js";
|
|
4
|
+
//#region src/dto/PdfLinkTarget.ts
|
|
5
|
+
/**
|
|
6
|
+
* The action tree the engine writes for a target a write can make: one URI,
|
|
7
|
+
* GoTo or Named action, as a read of it returns it. Links and outline items
|
|
8
|
+
* both write their targets this way.
|
|
9
|
+
*/
|
|
10
|
+
function actionTreeOf(target) {
|
|
11
|
+
return {
|
|
12
|
+
root: target.kind === "uri" ? {
|
|
13
|
+
type: "uri",
|
|
14
|
+
subtype: "URI",
|
|
15
|
+
uri: target.uri,
|
|
16
|
+
isMap: false,
|
|
17
|
+
next: []
|
|
18
|
+
} : target.kind === "goto" ? {
|
|
19
|
+
type: "goto",
|
|
20
|
+
subtype: "GoTo",
|
|
21
|
+
destination: target.destination,
|
|
22
|
+
next: []
|
|
23
|
+
} : {
|
|
24
|
+
type: "named",
|
|
25
|
+
subtype: "Named",
|
|
26
|
+
name: target.name,
|
|
27
|
+
next: []
|
|
28
|
+
},
|
|
29
|
+
incomplete: false,
|
|
30
|
+
warningFlags: 0,
|
|
31
|
+
warnings: []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/geometry/printSize.ts
|
|
36
|
+
/**
|
|
37
|
+
* The paper a print picture is sized for, in points: the larger of A4
|
|
38
|
+
* (595 × 842) and Letter (612 × 792) on each side.
|
|
39
|
+
*/
|
|
40
|
+
const PRINT_PAPER = {
|
|
41
|
+
long: 842,
|
|
42
|
+
short: 612
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The scale (pixels per point) of a print picture of a page `size` points
|
|
46
|
+
* big at `dpi` dots per inch of paper. A page that fits on the paper is
|
|
47
|
+
* drawn at its own size at that DPI; a bigger one gets no more pixels than
|
|
48
|
+
* it needs shrunk to fit, since the printer would throw the rest away. An
|
|
49
|
+
* A0 drawing printed on office paper needs no more; printed at its own
|
|
50
|
+
* size, it needs vectors (the print copy). Portrait or landscape doesn't
|
|
51
|
+
* matter.
|
|
52
|
+
*/
|
|
53
|
+
function printScale(size, dpi) {
|
|
54
|
+
const long = Math.max(size.width, size.height);
|
|
55
|
+
const short = Math.min(size.width, size.height);
|
|
56
|
+
const fit = Math.min(1, PRINT_PAPER.long / long, PRINT_PAPER.short / short);
|
|
57
|
+
return dpi / 72 * fit;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
4
60
|
//#region src/geometry/renderSize.ts
|
|
5
61
|
/**
|
|
6
62
|
* The pixel size of a render: an area of `width` × `height` points, turned
|
|
7
63
|
* by `rotation` (width and height swap on a quarter turn) and sized by
|
|
8
|
-
* `viewport`.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
64
|
+
* `viewport`. A `dpi` viewport sizes a print picture for its paper
|
|
65
|
+
* ({@link printScale}). The local worker allocates exactly this; the cloud
|
|
66
|
+
* client reports it without rendering. `InvalidArg` for a viewport that
|
|
67
|
+
* isn't positive.
|
|
11
68
|
*/
|
|
12
69
|
function renderSize(area, rotation, viewport) {
|
|
13
70
|
const swap = rotation === 90 || rotation === 270;
|
|
@@ -21,7 +78,7 @@ function renderSize(area, rotation, viewport) {
|
|
|
21
78
|
height: Math.max(1, Math.round(width * baseHeight / baseWidth))
|
|
22
79
|
};
|
|
23
80
|
}
|
|
24
|
-
const scale = viewport.scale ?? 1;
|
|
81
|
+
const scale = viewport.kind === "dpi" ? printScale(area, viewport.dpi) : viewport.scale ?? 1;
|
|
25
82
|
if (!Number.isFinite(scale) || scale <= 0) throw new EngineError(EngineErrorCode.InvalidArg, "render viewport scale must be positive");
|
|
26
83
|
return {
|
|
27
84
|
width: Math.max(1, Math.round(baseWidth * scale)),
|
|
@@ -327,6 +384,19 @@ function reasonMessage(reason) {
|
|
|
327
384
|
}
|
|
328
385
|
}
|
|
329
386
|
//#endregion
|
|
387
|
+
//#region src/identity/OutlineItemRef.ts
|
|
388
|
+
/** Build the address for an outline item from its object number. */
|
|
389
|
+
function toOutlineItemRef(objectNumber) {
|
|
390
|
+
return {
|
|
391
|
+
kind: "objectNumber",
|
|
392
|
+
objectNumber
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
/** Structural equality for two outline item addresses. */
|
|
396
|
+
function outlineItemRefsEqual(a, b) {
|
|
397
|
+
return a.kind === b.kind && a.objectNumber === b.objectNumber;
|
|
398
|
+
}
|
|
399
|
+
//#endregion
|
|
330
400
|
//#region src/resource/BinarySource.ts
|
|
331
401
|
function isBlob$1(value) {
|
|
332
402
|
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
@@ -690,6 +760,13 @@ const AnnotationTransfer = bundleCodec({
|
|
|
690
760
|
});
|
|
691
761
|
//#endregion
|
|
692
762
|
//#region src/dto/Attachment.ts
|
|
763
|
+
/**
|
|
764
|
+
* How much of a file the local engine decodes: a download of a larger file,
|
|
765
|
+
* from either home, is refused with `PayloadTooLarge`, before a small stream
|
|
766
|
+
* that inflates to gigabytes takes the tab down. A file's declared size
|
|
767
|
+
* can't be trusted. The cloud engine has its server's limit.
|
|
768
|
+
*/
|
|
769
|
+
const ATTACHMENT_LIMITS = { decodedBytes: 256 * 1024 * 1024 };
|
|
693
770
|
/** The ref of an attachment whose name-tree key you already hold. */
|
|
694
771
|
function toAttachmentRef(key) {
|
|
695
772
|
return {
|
|
@@ -817,26 +894,6 @@ function followingReads(current, resolved) {
|
|
|
817
894
|
};
|
|
818
895
|
return { actions: Object.keys(actions).length > 0 ? actions : null };
|
|
819
896
|
}
|
|
820
|
-
/** The action tree the engine writes for a link target: one URI or GoTo action. */
|
|
821
|
-
function actionTreeOf(target) {
|
|
822
|
-
return {
|
|
823
|
-
root: target.kind === "uri" ? {
|
|
824
|
-
type: "uri",
|
|
825
|
-
subtype: "URI",
|
|
826
|
-
uri: target.uri,
|
|
827
|
-
isMap: false,
|
|
828
|
-
next: []
|
|
829
|
-
} : {
|
|
830
|
-
type: "goto",
|
|
831
|
-
subtype: "GoTo",
|
|
832
|
-
destination: target.destination,
|
|
833
|
-
next: []
|
|
834
|
-
},
|
|
835
|
-
incomplete: false,
|
|
836
|
-
warningFlags: 0,
|
|
837
|
-
warnings: []
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
897
|
//#endregion
|
|
841
898
|
//#region src/annotation/defaults.ts
|
|
842
899
|
const RED = "#ff0000";
|
|
@@ -2399,6 +2456,6 @@ function measureFromRatio(paper, real, unit, options = {}) {
|
|
|
2399
2456
|
return build(userUnit / 72 * .0254 * (real / paper) / METRES[unit], unit, `${paper}:${real}`, format);
|
|
2400
2457
|
}
|
|
2401
2458
|
//#endregion
|
|
2402
|
-
export { pdfAppearanceTurnOf as $, createPdfTextLayout as A,
|
|
2459
|
+
export { pdfAppearanceTurnOf as $, createPdfTextLayout as A, pageTransform as At, mapActionNode as B, resolveAnnotationPatch as C, isRotatedGeometryRun as Ct, pageGeometryOf as D, pdfPointOf as Dt, createTextLayout as E, pageQuadOf as Et, pdfAnnotationOf as F, renderSize as Ft, mapLinkTarget as G, mapAnnotationActions as H, pdfAnnotationPatchOf as I, PRINT_PAPER as It, pageDestinationOf as J, mapPageActions as K, pageMeasureOf as L, printScale as Lt, pageAnnotationOf as M, renderMatrix as Mt, pageAnnotationPatchOf as N, renderTargetArea as Nt, pageSearchSliceOf as O, pdfQuadOf as Ot, pdfAnnotationDraftOf as P, renderTransform as Pt, applyResolvedPatch as Q, pageViewportsOf as R, actionTreeOf as Rt, resolveAnnotationDraft as S, glyphLooseQuad as St, shapeForRect as T, pagePointOf as Tt, mapDocumentActions as U, mapActionTree as V, mapFieldActions as W, ANNOTATION_DEFAULTS as X, pdfDestinationOf as Y, annotationDefaultsOf as Z, pagePointUnturned as _, outlineItemRefsEqual as _t, squareMetres as a, bundleCodec as at, pageTurnOfDrawn as b, isAbortError as bt, foldText as c, manifestBytesOf as ct, appearanceTurnOf as d, assertAnnotationResources as dt, ATTACHMENT_LIMITS as et, applyAnnotationPatch as f, hasAnnotationResources as ft, pagePointTurned as g, resolveBinarySource as gt, pageGlyphLooseQuad as h, sniffBinaryMetadata as ht, areaUnitLabel as i, assertAnnotationBundleManifest as it, pageAnnotationDraftOf as j, renderAreaTransform as jt, pageTextSegmentOf as k, pdfRectOf as kt, toOriginalRange as l, ANNOTATION_RESOURCE_ROLE_NAMES as lt, pageGlyphLooseBounds as m, withFileFromResource as mt, measureFromRatio as n, AnnotationTransfer as nt, squareOf as o, DEFAULT_BUNDLE_LIMITS as ot, drawnPointsOf as p, resolveAnnotationResources as pt, mapTriggerActions as q, METRES as r, assertAnnotationBundle as rt, SEARCH_FOLD_VERSION as s, assertWithinLimit as st, measureFromKnownLength as t, toAttachmentRef as tt, annotationOfDraft as u, annotationResourceBuffers as ut, pagePointsBounds as v, toOutlineItemRef as vt, resolveRectCommand as w, pageBoxOf as wt, pageTurnOfUpright as x, glyphLooseBounds as xt, pageQuadBounds as y, AbortError as yt, pdfMeasureOf as z };
|
|
2403
2460
|
|
|
2404
|
-
//# sourceMappingURL=calibrate-
|
|
2461
|
+
//# sourceMappingURL=calibrate-nQFgCuki.js.map
|