@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.
@@ -20,8 +20,8 @@
20
20
  */
21
21
 
22
22
  /**
23
- * pdfjsVersion = 6.4.299-box.2
24
- * pdfjsBuild = 9c8224a
23
+ * pdfjsVersion = 6.4.299-box.3
24
+ * pdfjsBuild = acc2002
25
25
  */
26
26
  /******/ var __webpack_modules__ = ({
27
27
 
@@ -7838,6 +7838,16 @@ function renderRichText({
7838
7838
  fragment.firstElementChild.classList.add("richText", className);
7839
7839
  container.append(fragment);
7840
7840
  }
7841
+ let isBoxChangesSwitchOn = true;
7842
+ function setBoxChangesEnabled(enabled) {
7843
+ if (typeof enabled !== "boolean") {
7844
+ throw new Error("Invalid `enabled` type.");
7845
+ }
7846
+ isBoxChangesSwitchOn = enabled;
7847
+ }
7848
+ function areBoxChangesEnabled() {
7849
+ return isBoxChangesSwitchOn;
7850
+ }
7841
7851
  const axisAlignedClipPaths = new WeakMap();
7842
7852
  const NEAR_ZERO_TRANSFORM_RATIO = 1e-6;
7843
7853
  const MIN_SNAPPED_CLIP_SIZE = 2;
@@ -7953,6 +7963,9 @@ function recordClipPath(path, data) {
7953
7963
  }
7954
7964
  }
7955
7965
  function getPixelSnappedClipPath(path, transform) {
7966
+ if (!areBoxChangesEnabled()) {
7967
+ return path;
7968
+ }
7956
7969
  const axisAlignedPath = axisAlignedClipPaths.get(path);
7957
7970
  const snappedDrawOPS = axisAlignedPath && snapAxisAlignedPath(axisAlignedPath, transform);
7958
7971
  return snappedDrawOPS ? makePathFromDrawOPS(snappedDrawOPS) : path;
@@ -8316,7 +8329,7 @@ class FloatingToolbar {
8316
8329
  }
8317
8330
 
8318
8331
  ;// ./src/shared/internal_evt.js
8319
- const INTERNAL_EVT = "b73885cd-1954-4723-8cc0-0364b7abb527";
8332
+ const INTERNAL_EVT = "1f166d3a-715c-4c7a-a062-1e0ddfefab93";
8320
8333
  const internalOpt = Object.freeze({
8321
8334
  internal: INTERNAL_EVT
8322
8335
  });
@@ -16969,7 +16982,8 @@ function mirrorContextOperations(ctx, destCtx) {
16969
16982
  function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) {
16970
16983
  const transform = getCurrentTransform(ctx);
16971
16984
  const [a, b, c, d, tx, ty] = transform;
16972
- if (isAxisAlignedScale(transform)) {
16985
+ const isRoundingTolerated = areBoxChangesEnabled();
16986
+ if (isRoundingTolerated ? isAxisAlignedScale(transform) : b === 0 && c === 0) {
16973
16987
  const tlX = destX * a + tx;
16974
16988
  const rTlX = Math.round(tlX);
16975
16989
  const tlY = destY * d + ty;
@@ -16983,7 +16997,7 @@ function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, de
16983
16997
  ctx.setTransform(a, b, c, d, tx, ty);
16984
16998
  return [rWidth, rHeight];
16985
16999
  }
16986
- if (isQuarterTurn(transform)) {
17000
+ if (isRoundingTolerated ? isQuarterTurn(transform) : a === 0 && d === 0) {
16987
17001
  const tlX = destY * c + tx;
16988
17002
  const rTlX = Math.round(tlX);
16989
17003
  const tlY = destX * b + ty;
@@ -21937,7 +21951,7 @@ function getDocument(src = {}) {
21937
21951
  }
21938
21952
  const docParams = {
21939
21953
  docId,
21940
- apiVersion: "6.4.299-box.2",
21954
+ apiVersion: "6.4.299-box.3",
21941
21955
  data,
21942
21956
  password,
21943
21957
  disableAutoFetch,
@@ -23638,8 +23652,8 @@ class InternalRenderTask {
23638
23652
  }
23639
23653
  }
23640
23654
  }
23641
- const api_version = "6.4.299-box.2";
23642
- const build = "9c8224a";
23655
+ const api_version = "6.4.299-box.3";
23656
+ const build = "acc2002";
23643
23657
 
23644
23658
  ;// ./node_modules/core-js/modules/es.math.sum-precise.js
23645
23659
  es_math_sum_precise_namespaceFn();
@@ -34779,6 +34793,7 @@ globalThis.pdfjsLib = {
34779
34793
  RenderingCancelledException: RenderingCancelledException,
34780
34794
  renderRichText: renderRichText,
34781
34795
  ResponseException: ResponseException,
34796
+ setBoxChangesEnabled: setBoxChangesEnabled,
34782
34797
  setLayerDimensions: setLayerDimensions,
34783
34798
  shadow: util_shadow,
34784
34799
  SignatureExtractor: SignatureExtractor,
@@ -34794,6 +34809,6 @@ globalThis.pdfjsLib = {
34794
34809
  XfaLayer: XfaLayer
34795
34810
  };
34796
34811
 
34797
- 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, util_shadow as shadow, stopEvent, updateUrlHash, api_version as version };
34812
+ 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, util_shadow as shadow, stopEvent, updateUrlHash, api_version as version };
34798
34813
 
34799
34814
  //# sourceMappingURL=pdf.mjs.map