@box/pdfjs-dist 6.4.299-box.2 → 6.4.299-box.3
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/CHANGELOG.md +4 -0
- package/build/pdf.min.mjs +4 -4
- package/build/pdf.mjs +24 -9
- package/build/pdf.mjs.map +1 -1
- package/build/pdf.sandbox.min.mjs +2 -2
- package/build/pdf.sandbox.mjs +2 -2
- package/build/pdf.worker.min.mjs +3 -3
- package/build/pdf.worker.mjs +3 -3
- package/image_decoders/pdf.image_decoders.min.mjs +2 -2
- package/image_decoders/pdf.image_decoders.mjs +2 -2
- package/legacy/build/pdf.min.mjs +4 -4
- package/legacy/build/pdf.mjs +24 -9
- package/legacy/build/pdf.mjs.map +1 -1
- package/legacy/build/pdf.sandbox.min.mjs +2 -2
- package/legacy/build/pdf.sandbox.mjs +2 -2
- package/legacy/build/pdf.worker.min.mjs +3 -3
- package/legacy/build/pdf.worker.mjs +3 -3
- package/legacy/image_decoders/pdf.image_decoders.min.mjs +2 -2
- package/legacy/image_decoders/pdf.image_decoders.mjs +2 -2
- package/legacy/web/pdf_viewer.mjs +5 -4
- package/legacy/web/pdf_viewer.mjs.map +1 -1
- package/package.json +2 -2
- package/types/src/display/display_utils.d.ts +8 -0
- package/types/src/pdf.d.ts +2 -1
- package/web/pdf_viewer.mjs +5 -4
- package/web/pdf_viewer.mjs.map +1 -1
package/build/pdf.mjs
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* pdfjsVersion = 6.4.299-box.
|
|
24
|
-
* pdfjsBuild =
|
|
23
|
+
* pdfjsVersion = 6.4.299-box.3
|
|
24
|
+
* pdfjsBuild = acc2002
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
;// ./src/shared/util.js
|
|
@@ -1759,6 +1759,16 @@ function renderRichText({
|
|
|
1759
1759
|
fragment.firstElementChild.classList.add("richText", className);
|
|
1760
1760
|
container.append(fragment);
|
|
1761
1761
|
}
|
|
1762
|
+
let isBoxChangesSwitchOn = true;
|
|
1763
|
+
function setBoxChangesEnabled(enabled) {
|
|
1764
|
+
if (typeof enabled !== "boolean") {
|
|
1765
|
+
throw new Error("Invalid `enabled` type.");
|
|
1766
|
+
}
|
|
1767
|
+
isBoxChangesSwitchOn = enabled;
|
|
1768
|
+
}
|
|
1769
|
+
function areBoxChangesEnabled() {
|
|
1770
|
+
return isBoxChangesSwitchOn;
|
|
1771
|
+
}
|
|
1762
1772
|
const axisAlignedClipPaths = new WeakMap();
|
|
1763
1773
|
const NEAR_ZERO_TRANSFORM_RATIO = 1e-6;
|
|
1764
1774
|
const MIN_SNAPPED_CLIP_SIZE = 2;
|
|
@@ -1874,6 +1884,9 @@ function recordClipPath(path, data) {
|
|
|
1874
1884
|
}
|
|
1875
1885
|
}
|
|
1876
1886
|
function getPixelSnappedClipPath(path, transform) {
|
|
1887
|
+
if (!areBoxChangesEnabled()) {
|
|
1888
|
+
return path;
|
|
1889
|
+
}
|
|
1877
1890
|
const axisAlignedPath = axisAlignedClipPaths.get(path);
|
|
1878
1891
|
const snappedDrawOPS = axisAlignedPath && snapAxisAlignedPath(axisAlignedPath, transform);
|
|
1879
1892
|
return snappedDrawOPS ? makePathFromDrawOPS(snappedDrawOPS) : path;
|
|
@@ -2213,7 +2226,7 @@ class FloatingToolbar {
|
|
|
2213
2226
|
}
|
|
2214
2227
|
|
|
2215
2228
|
;// ./src/shared/internal_evt.js
|
|
2216
|
-
const INTERNAL_EVT = "
|
|
2229
|
+
const INTERNAL_EVT = "1f166d3a-715c-4c7a-a062-1e0ddfefab93";
|
|
2217
2230
|
const internalOpt = Object.freeze({
|
|
2218
2231
|
internal: INTERNAL_EVT
|
|
2219
2232
|
});
|
|
@@ -10702,7 +10715,8 @@ function mirrorContextOperations(ctx, destCtx) {
|
|
|
10702
10715
|
function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) {
|
|
10703
10716
|
const transform = getCurrentTransform(ctx);
|
|
10704
10717
|
const [a, b, c, d, tx, ty] = transform;
|
|
10705
|
-
|
|
10718
|
+
const isRoundingTolerated = areBoxChangesEnabled();
|
|
10719
|
+
if (isRoundingTolerated ? isAxisAlignedScale(transform) : b === 0 && c === 0) {
|
|
10706
10720
|
const tlX = destX * a + tx;
|
|
10707
10721
|
const rTlX = Math.round(tlX);
|
|
10708
10722
|
const tlY = destY * d + ty;
|
|
@@ -10716,7 +10730,7 @@ function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, de
|
|
|
10716
10730
|
ctx.setTransform(a, b, c, d, tx, ty);
|
|
10717
10731
|
return [rWidth, rHeight];
|
|
10718
10732
|
}
|
|
10719
|
-
if (isQuarterTurn(transform)) {
|
|
10733
|
+
if (isRoundingTolerated ? isQuarterTurn(transform) : a === 0 && d === 0) {
|
|
10720
10734
|
const tlX = destY * c + tx;
|
|
10721
10735
|
const rTlX = Math.round(tlX);
|
|
10722
10736
|
const tlY = destX * b + ty;
|
|
@@ -15589,7 +15603,7 @@ function getDocument(src = {}) {
|
|
|
15589
15603
|
}
|
|
15590
15604
|
const docParams = {
|
|
15591
15605
|
docId,
|
|
15592
|
-
apiVersion: "6.4.299-box.
|
|
15606
|
+
apiVersion: "6.4.299-box.3",
|
|
15593
15607
|
data,
|
|
15594
15608
|
password,
|
|
15595
15609
|
disableAutoFetch,
|
|
@@ -17290,8 +17304,8 @@ class InternalRenderTask {
|
|
|
17290
17304
|
}
|
|
17291
17305
|
}
|
|
17292
17306
|
}
|
|
17293
|
-
const version = "6.4.299-box.
|
|
17294
|
-
const build = "
|
|
17307
|
+
const version = "6.4.299-box.3";
|
|
17308
|
+
const build = "acc2002";
|
|
17295
17309
|
|
|
17296
17310
|
;// ./src/display/editor/color_picker.js
|
|
17297
17311
|
|
|
@@ -28316,6 +28330,7 @@ globalThis.pdfjsLib = {
|
|
|
28316
28330
|
RenderingCancelledException: RenderingCancelledException,
|
|
28317
28331
|
renderRichText: renderRichText,
|
|
28318
28332
|
ResponseException: ResponseException,
|
|
28333
|
+
setBoxChangesEnabled: setBoxChangesEnabled,
|
|
28319
28334
|
setLayerDimensions: setLayerDimensions,
|
|
28320
28335
|
shadow: shadow,
|
|
28321
28336
|
SignatureExtractor: SignatureExtractor,
|
|
@@ -28331,6 +28346,6 @@ globalThis.pdfjsLib = {
|
|
|
28331
28346
|
XfaLayer: XfaLayer
|
|
28332
28347
|
};
|
|
28333
28348
|
|
|
28334
|
-
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, CSSConstants, ColorPicker, DOMSVGFactory, DrawLayer, FeatureTest, GlobalWorkerOptions, ImageKind, InvalidPDFException, MathClamp, OPS, OutputScale, PDFDataRangeTransport, PDFDateString, PDFWorker, PasswordException, PasswordResponses, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, SignatureExtractor, SupportedImageMimeTypes, TextLayer, TextLayerImages, TouchManager, Util, VerbosityLevel, XfaLayer, applyOpacity, build, createValidAbsoluteUrl, fetchData, findContrastColor, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, getRGBA, getUuid, isDataScheme, isPdfFile, isValidExplicitDest, makeArr, makeMap, makeObj, makeSet, noContextMenu, normalizeUnicode, renderRichText, setLayerDimensions, shadow, stopEvent, updateUrlHash, version };
|
|
28349
|
+
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, CSSConstants, ColorPicker, DOMSVGFactory, DrawLayer, FeatureTest, GlobalWorkerOptions, ImageKind, InvalidPDFException, MathClamp, OPS, OutputScale, PDFDataRangeTransport, PDFDateString, PDFWorker, PasswordException, PasswordResponses, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, SignatureExtractor, SupportedImageMimeTypes, TextLayer, TextLayerImages, TouchManager, Util, VerbosityLevel, XfaLayer, applyOpacity, build, createValidAbsoluteUrl, fetchData, findContrastColor, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, getRGBA, getUuid, isDataScheme, isPdfFile, isValidExplicitDest, makeArr, makeMap, makeObj, makeSet, noContextMenu, normalizeUnicode, renderRichText, setBoxChangesEnabled, setLayerDimensions, shadow, stopEvent, updateUrlHash, version };
|
|
28335
28350
|
|
|
28336
28351
|
//# sourceMappingURL=pdf.mjs.map
|