diff --git a/external/builder/builder.js b/external/builder/builder.js index 2120d683f..e5643cb1f 100644 --- a/external/builder/builder.js +++ b/external/builder/builder.js @@ -122,7 +122,8 @@ function preprocess(inFilename, outFilename, defines) { let line; let state = STATE_NONE; const stack = []; - const control = /^(?:\/\/|)?$)?/; + const control = + /^(?:\/\/|)?$)?/; while ((line = readLine()) !== null) { ++lineNumber; diff --git a/external/cmapscompress/parse.js b/external/cmapscompress/parse.js index 1565eaa17..7850f6946 100644 --- a/external/cmapscompress/parse.js +++ b/external/cmapscompress/parse.js @@ -36,7 +36,8 @@ exports.parseAdobeCMap = function (content) { if (m) { result.usecmap = m[1]; } - const re = /(\d+)\s+(begincodespacerange|beginnotdefrange|begincidchar|begincidrange|beginbfchar|beginbfrange)\n([\s\S]*?)\n(endcodespacerange|endnotdefrange|endcidchar|endcidrange|endbfchar|endbfrange)/g; + const re = + /(\d+)\s+(begincodespacerange|beginnotdefrange|begincidchar|begincidrange|beginbfchar|beginbfrange)\n([\s\S]*?)\n(endcodespacerange|endnotdefrange|endcidchar|endcidrange|endbfchar|endbfrange)/g; while ((m = re.exec(body))) { const lines = m[3].toLowerCase().split("\n"); diff --git a/gulpfile.js b/gulpfile.js index fd00edf2e..e49c0777e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -756,8 +756,8 @@ gulp.task("cmaps", function (done) { } }); - const compressCmaps = require("./external/cmapscompress/compress.js") - .compressCmaps; + const compressCmaps = + require("./external/cmapscompress/compress.js").compressCmaps; compressCmaps(CMAP_INPUT, VIEWER_CMAP_OUTPUT, true); done(); }); @@ -1415,7 +1415,8 @@ function buildLibHelper(bundleDefines, inputStream, outputDir) { babelPluginReplaceNonWebPackRequire, ], }).code; - const removeCjsSrc = /^(var\s+\w+\s*=\s*(_interopRequireDefault\()?require\(".*?)(?:\/src)(\/[^"]*"\)\)?;)$/gm; + const removeCjsSrc = + /^(var\s+\w+\s*=\s*(_interopRequireDefault\()?require\(".*?)(?:\/src)(\/[^"]*"\)\)?;)$/gm; content = content.replace(removeCjsSrc, (all, prefix, interop, suffix) => { return prefix + suffix; }); @@ -2176,9 +2177,8 @@ gulp.task( let reason = process.env.PDFJS_UPDATE_REASON; // Attempt to work-around the broken link, see https://github.com/mozilla/pdf.js/issues/10391 if (typeof reason === "string") { - const reasonParts = /^(See )(mozilla\/pdf\.js)@tags\/(v\d+\.\d+\.\d+)\s*$/.exec( - reason - ); + const reasonParts = + /^(See )(mozilla\/pdf\.js)@tags\/(v\d+\.\d+\.\d+)\s*$/.exec(reason); if (reasonParts) { reason = diff --git a/src/core/annotation.js b/src/core/annotation.js index 38b43e4e5..b735efbf3 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -1589,11 +1589,8 @@ class WidgetAnnotation extends Annotation { "Expected `_defaultAppearanceData` to have been set." ); } - const { - localResources, - appearanceResources, - acroFormResources, - } = this._fieldResources; + const { localResources, appearanceResources, acroFormResources } = + this._fieldResources; const fontName = this.data.defaultAppearanceData && diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 4dff62ce8..b708825d4 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -3205,9 +3205,8 @@ class PartialEvaluator { // text-extraction. For simple fonts, containing encoding information, // use a fallback ToUnicode map to improve this (fixes issue8229.pdf). if (!properties.composite && properties.hasEncoding) { - properties.fallbackToUnicode = this._buildSimpleFontToUnicode( - properties - ); + properties.fallbackToUnicode = + this._buildSimpleFontToUnicode(properties); } return Promise.resolve(properties.toUnicode); diff --git a/src/core/fonts.js b/src/core/fonts.js index c7d788ed4..b640f4935 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -999,12 +999,14 @@ class Font { map[+charCode] = GlyphMapForStandardFonts[charCode]; } if (/Arial-?Black/i.test(name)) { - const SupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack(); + const SupplementalGlyphMapForArialBlack = + getSupplementalGlyphMapForArialBlack(); for (const charCode in SupplementalGlyphMapForArialBlack) { map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; } } else if (/Calibri/i.test(name)) { - const SupplementalGlyphMapForCalibri = getSupplementalGlyphMapForCalibri(); + const SupplementalGlyphMapForCalibri = + getSupplementalGlyphMapForCalibri(); for (const charCode in SupplementalGlyphMapForCalibri) { map[+charCode] = SupplementalGlyphMapForCalibri[charCode]; } @@ -1801,22 +1803,7 @@ class Font { // glyf table cannot be empty -- redoing the glyf and loca tables // to have single glyph with one point const simpleGlyph = new Uint8Array([ - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 49, - 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, ]); for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) { itemEncode(locaData, j, simpleGlyph.length); @@ -2707,9 +2694,8 @@ class Font { return charCode | 0; } } - newMapping.charCodeToGlyphId[ - newMapping.nextAvailableFontCharCode - ] = glyphId; + newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = + glyphId; return newMapping.nextAvailableFontCharCode++; } diff --git a/src/core/xfa/xhtml.js b/src/core/xfa/xhtml.js index f87d266cb..3dfdfa997 100644 --- a/src/core/xfa/xhtml.js +++ b/src/core/xfa/xhtml.js @@ -117,9 +117,8 @@ function mapStyle(styleStr) { style.transform = newValue; } } else { - style[ - key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase()) - ] = newValue; + style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = + newValue; } } return style; diff --git a/src/display/api.js b/src/display/api.js index 485719971..714323a39 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -3070,13 +3070,8 @@ const InternalRenderTask = (function InternalRenderTaskClosure() { this.stepper.init(this.operatorList); this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); } - const { - canvasContext, - viewport, - transform, - imageLayer, - background, - } = this.params; + const { canvasContext, viewport, transform, imageLayer, background } = + this.params; this.gfx = new CanvasGraphics( canvasContext, diff --git a/src/display/fetch_stream.js b/src/display/fetch_stream.js index 40be6dd05..f2225fa49 100644 --- a/src/display/fetch_stream.js +++ b/src/display/fetch_stream.js @@ -141,15 +141,13 @@ class PDFFetchStreamReader { const getResponseHeader = name => { return response.headers.get(name); }; - const { - allowRangeRequests, - suggestedLength, - } = validateRangeRequestCapabilities({ - getResponseHeader, - isHttp: this._stream.isHttp, - rangeChunkSize: this._rangeChunkSize, - disableRange: this._disableRange, - }); + const { allowRangeRequests, suggestedLength } = + validateRangeRequestCapabilities({ + getResponseHeader, + isHttp: this._stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange, + }); this._isRangeSupported = allowRangeRequests; // Setting right content length. diff --git a/src/display/network.js b/src/display/network.js index a2f4642d1..892acbb37 100644 --- a/src/display/network.js +++ b/src/display/network.js @@ -305,15 +305,13 @@ class PDFNetworkStreamFullRequestReader { const getResponseHeader = name => { return fullRequestXhr.getResponseHeader(name); }; - const { - allowRangeRequests, - suggestedLength, - } = validateRangeRequestCapabilities({ - getResponseHeader, - isHttp: this._manager.isHttp, - rangeChunkSize: this._rangeChunkSize, - disableRange: this._disableRange, - }); + const { allowRangeRequests, suggestedLength } = + validateRangeRequestCapabilities({ + getResponseHeader, + isHttp: this._manager.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange, + }); if (allowRangeRequests) { this._isRangeSupported = true; diff --git a/src/display/node_stream.js b/src/display/node_stream.js index ba6f668fd..1079f3423 100644 --- a/src/display/node_stream.js +++ b/src/display/node_stream.js @@ -330,15 +330,13 @@ class PDFNodeStreamFullReader extends BaseFullReader { // here: https://nodejs.org/api/http.html#http_message_headers. return this._readableStream.headers[name.toLowerCase()]; }; - const { - allowRangeRequests, - suggestedLength, - } = validateRangeRequestCapabilities({ - getResponseHeader, - isHttp: stream.isHttp, - rangeChunkSize: this._rangeChunkSize, - disableRange: this._disableRange, - }); + const { allowRangeRequests, suggestedLength } = + validateRangeRequestCapabilities({ + getResponseHeader, + isHttp: stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange, + }); this._isRangeSupported = allowRangeRequests; // Setting right content length. diff --git a/src/display/svg.js b/src/display/svg.js index e83d14abd..bb4648bc5 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -52,14 +52,7 @@ if ( const convertImgDataToPng = (function () { const PNG_HEADER = new Uint8Array([ - 0x89, - 0x50, - 0x4e, - 0x47, - 0x0d, - 0x0a, - 0x1a, - 0x0a, + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, ]); const CHUNK_WRAPPER_SIZE = 12; diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 7b3d82ca9..a56d17512 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -75,8 +75,12 @@ function getAscent(fontFamily, ctx) { ctx.strokeStyle = "red"; ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); ctx.strokeText("g", 0, 0); - let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE) - .data; + let pixels = ctx.getImageData( + 0, + 0, + DEFAULT_FONT_SIZE, + DEFAULT_FONT_SIZE + ).data; descent = 0; for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) { if (pixels[i] > 0) { diff --git a/src/scripting_api/util.js b/src/scripting_api/util.js index 4a55affae..f903d7cba 100644 --- a/src/scripting_api/util.js +++ b/src/scripting_api/util.js @@ -284,7 +284,8 @@ class Util extends PDFObject { seconds: oDate.getSeconds(), }; - const patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t|\\.)/g; + const patterns = + /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t|\\.)/g; return cFormat.replace(patterns, function (match, pattern) { if (pattern in handlers) { return handlers[pattern](data); @@ -517,7 +518,8 @@ class Util extends PDFObject { // escape the string const escapedFormat = cFormat.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); - const patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t)/g; + const patterns = + /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t)/g; const actions = []; const re = escapedFormat.replace( diff --git a/src/shared/compatibility.js b/src/shared/compatibility.js index 62efea713..707047b4a 100644 --- a/src/shared/compatibility.js +++ b/src/shared/compatibility.js @@ -100,6 +100,7 @@ if ( if (isReadableStreamSupported) { return; } - globalThis.ReadableStream = require("web-streams-polyfill/dist/ponyfill.js").ReadableStream; + globalThis.ReadableStream = + require("web-streams-polyfill/dist/ponyfill.js").ReadableStream; })(); } diff --git a/test/downloadutils.js b/test/downloadutils.js index 159d15a21..db13148b2 100644 --- a/test/downloadutils.js +++ b/test/downloadutils.js @@ -26,7 +26,8 @@ function rewriteWebArchiveUrl(url) { // Web Archive URLs need to be transformed to add `if_` after the ID. // Without this, an HTML page containing an iframe with the PDF file // will be served instead (issue 8920). - var webArchiveRegex = /(^https?:\/\/web\.archive\.org\/web\/)(\d+)(\/https?:\/\/.+)/g; + var webArchiveRegex = + /(^https?:\/\/web\.archive\.org\/web\/)(\d+)(\/https?:\/\/.+)/g; var urlParts = webArchiveRegex.exec(url); if (urlParts) { return urlParts[1] + (urlParts[2] + "if_") + urlParts[3]; diff --git a/test/driver.js b/test/driver.js index b7b6fcef1..052d7999c 100644 --- a/test/driver.js +++ b/test/driver.js @@ -422,7 +422,8 @@ var Driver = (function DriverClosure() { loadingTask.promise.then( doc => { task.pdfDoc = doc; - task.optionalContentConfigPromise = doc.getOptionalContentConfig(); + task.optionalContentConfigPromise = + doc.getOptionalContentConfig(); this._nextPage(task, failure); }, @@ -600,9 +601,8 @@ var Driver = (function DriverClosure() { } annotationLayerCanvas.width = viewport.width; annotationLayerCanvas.height = viewport.height; - var annotationLayerContext = annotationLayerCanvas.getContext( - "2d" - ); + var annotationLayerContext = + annotationLayerCanvas.getContext("2d"); annotationLayerContext.clearRect( 0, 0, diff --git a/test/test.js b/test/test.js index cf9eaf680..d4014c09c 100644 --- a/test/test.js +++ b/test/test.js @@ -843,8 +843,8 @@ function unitTestPostHandler(req, res) { } async function startBrowser(browserName, startUrl = "") { - const revisions = require("puppeteer/lib/cjs/puppeteer/revisions.js") - .PUPPETEER_REVISIONS; + const revisions = + require("puppeteer/lib/cjs/puppeteer/revisions.js").PUPPETEER_REVISIONS; const wantedRevision = browserName === "chrome" ? revisions.chromium : revisions.firefox; diff --git a/test/unit/annotation_spec.js b/test/unit/annotation_spec.js index b4bbc5f6f..7d8b50b45 100644 --- a/test/unit/annotation_spec.js +++ b/test/unit/annotation_spec.js @@ -230,24 +230,10 @@ describe("annotation", function () { it("should process quadpoints in the standard order", function () { rect = [10, 10, 20, 20]; - dict.set("QuadPoints", [ - 10, - 20, - 20, - 20, - 10, - 10, - 20, - 10, - 11, - 19, - 19, - 19, - 11, - 11, - 19, - 11, - ]); + dict.set( + "QuadPoints", + [10, 20, 20, 20, 10, 10, 20, 10, 11, 19, 19, 19, 11, 11, 19, 11] + ); expect(getQuadPoints(dict, rect)).toEqual([ [ { x: 10, y: 20 }, diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index 454351063..7aaf2be5d 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -1066,12 +1066,8 @@ describe("api", function () { }); it("gets metadata", async function () { - const { - info, - metadata, - contentDispositionFilename, - contentLength, - } = await pdfDocument.getMetadata(); + const { info, metadata, contentDispositionFilename, contentLength } = + await pdfDocument.getMetadata(); expect(info.Title).toEqual("Basic API Test"); // Custom, non-standard, information dictionary entries. @@ -1096,12 +1092,8 @@ describe("api", function () { buildGetDocumentParams("tracemonkey.pdf") ); const pdfDoc = await loadingTask.promise; - const { - info, - metadata, - contentDispositionFilename, - contentLength, - } = await pdfDoc.getMetadata(); + const { info, metadata, contentDispositionFilename, contentLength } = + await pdfDoc.getMetadata(); expect(info.Creator).toEqual("TeX"); expect(info.Producer).toEqual("pdfeTeX-1.21a"); @@ -1132,12 +1124,8 @@ describe("api", function () { it("gets metadata, with missing PDF header (bug 1606566)", async function () { const loadingTask = getDocument(buildGetDocumentParams("bug1606566.pdf")); const pdfDoc = await loadingTask.promise; - const { - info, - metadata, - contentDispositionFilename, - contentLength, - } = await pdfDoc.getMetadata(); + const { info, metadata, contentDispositionFilename, contentLength } = + await pdfDoc.getMetadata(); // The following are PDF.js specific, non-standard, properties. expect(info.PDFFormatVersion).toEqual(null); @@ -1445,13 +1433,12 @@ describe("api", function () { docBaseUrl: "qwerty.pdf", }) ); - const invalidDocBaseUrlPromise = invalidDocBaseUrlLoadingTask.promise.then( - function (pdfDoc) { + const invalidDocBaseUrlPromise = + invalidDocBaseUrlLoadingTask.promise.then(function (pdfDoc) { return pdfDoc.getPage(1).then(function (pdfPage) { return pdfPage.getAnnotations(); }); - } - ); + }); const [ defaultAnnotations, @@ -1804,7 +1791,8 @@ describe("api", function () { }); it("multiple render() on the same canvas", async function () { - const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig(); + const optionalContentConfigPromise = + pdfDocument.getOptionalContentConfig(); const viewport = page.getViewport({ scale: 1 }); const canvasAndCtx = CanvasFactory.create( diff --git a/test/unit/custom_spec.js b/test/unit/custom_spec.js index 562524778..0c562cda2 100644 --- a/test/unit/custom_spec.js +++ b/test/unit/custom_spec.js @@ -27,9 +27,8 @@ function getTopLeftPixel(canvasContext) { } describe("custom canvas rendering", function () { - const transparentGetDocumentParams = buildGetDocumentParams( - "transparent.pdf" - ); + const transparentGetDocumentParams = + buildGetDocumentParams("transparent.pdf"); let CanvasFactory; let loadingTask; diff --git a/web/app.js b/web/app.js index 213b8324a..f2c79b840 100644 --- a/web/app.js +++ b/web/app.js @@ -1497,12 +1497,8 @@ const PDFViewerApplication = { * @private */ async _initializeMetadata(pdfDocument) { - const { - info, - metadata, - contentDispositionFilename, - contentLength, - } = await pdfDocument.getMetadata(); + const { info, metadata, contentDispositionFilename, contentLength } = + await pdfDocument.getMetadata(); if (pdfDocument !== this.pdfDocument) { return; // The document was closed while the metadata resolved. @@ -1782,7 +1778,8 @@ const PDFViewerApplication = { forceRendering() { this.pdfRenderingQueue.printing = !!this.printService; - this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible; + this.pdfRenderingQueue.isThumbnailViewEnabled = + this.pdfSidebar.isThumbnailViewVisible; this.pdfRenderingQueue.renderHighestPriority(); }, @@ -1818,8 +1815,8 @@ const PDFViewerApplication = { const pagesOverview = this.pdfViewer.getPagesOverview(); const printContainer = this.appConfig.printContainer; const printResolution = AppOptions.get("printResolution"); - const optionalContentConfigPromise = this.pdfViewer - .optionalContentConfigPromise; + const optionalContentConfigPromise = + this.pdfViewer.optionalContentConfigPromise; const printService = PDFPrintServiceFactory.instance.createPrintService( this.pdfDocument, @@ -2422,7 +2419,8 @@ function webViewerUpdateViewarea(evt) { location.pdfOpenParams ); PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href; - PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href; + PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = + href; // Show/hide the loading indicator in the page number input element. const currentPage = PDFViewerApplication.pdfViewer.getPageView( @@ -2684,10 +2682,8 @@ function setZoomDisabledTimeout() { } function webViewerWheel(evt) { - const { - pdfViewer, - supportedMouseWheelZoomModifierKeys, - } = PDFViewerApplication; + const { pdfViewer, supportedMouseWheelZoomModifierKeys } = + PDFViewerApplication; if (pdfViewer.isInPresentationMode) { return; diff --git a/web/chromecom.js b/web/chromecom.js index c49c020fe..823251221 100644 --- a/web/chromecom.js +++ b/web/chromecom.js @@ -184,9 +184,8 @@ function requestAccessToLocalFile(fileUrl, overlayManager, callback) { )[chrome.i18n.getUILanguage?.()]; if (i18nFileAccessLabel) { - document.getElementById( - "chrome-file-access-label" - ).textContent = i18nFileAccessLabel; + document.getElementById("chrome-file-access-label").textContent = + i18nFileAccessLabel; } const link = document.getElementById("chrome-link-to-extensions-page"); diff --git a/web/generic_scripting.js b/web/generic_scripting.js index 08cfff3a1..62a413525 100644 --- a/web/generic_scripting.js +++ b/web/generic_scripting.js @@ -18,14 +18,9 @@ import { getPdfFilenameFromUrl, loadScript } from "pdfjs-lib"; async function docPropertiesLookup(pdfDocument) { const url = "", baseUrl = url.split("#")[0]; - /* eslint-disable prefer-const */ - let { - info, - metadata, - contentDispositionFilename, - contentLength, - } = await pdfDocument.getMetadata(); - /* eslint-enable prefer-const */ + // eslint-disable-next-line prefer-const + let { info, metadata, contentDispositionFilename, contentLength } = + await pdfDocument.getMetadata(); if (!contentLength) { const { length } = await pdfDocument.getDownloadInfo(); diff --git a/web/pdf_layer_viewer.js b/web/pdf_layer_viewer.js index 837ceecb6..2c90988bc 100644 --- a/web/pdf_layer_viewer.js +++ b/web/pdf_layer_viewer.js @@ -181,7 +181,8 @@ class PDFLayerViewer extends BaseTreeViewer { return; } // Fetch the default optional content configuration... - const optionalContentConfig = await this._pdfDocument.getOptionalContentConfig(); + const optionalContentConfig = + await this._pdfDocument.getOptionalContentConfig(); this.eventBus.dispatch("optionalcontentconfig", { source: this, diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 0c157402d..ee85d4809 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -365,10 +365,14 @@ class PDFPageView { const width = this.viewport.width; const height = this.viewport.height; const div = this.div; - target.style.width = target.parentNode.style.width = div.style.width = - Math.floor(width) + "px"; - target.style.height = target.parentNode.style.height = div.style.height = - Math.floor(height) + "px"; + target.style.width = + target.parentNode.style.width = + div.style.width = + Math.floor(width) + "px"; + target.style.height = + target.parentNode.style.height = + div.style.height = + Math.floor(height) + "px"; // The canvas may have been originally rotated; rotate relative to that. const relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation; @@ -579,17 +583,18 @@ class PDFPageView { if (this.annotationLayerFactory) { if (!this.annotationLayer) { - this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder( - div, - pdfPage, - /* annotationStorage = */ null, - this.imageResourcesPath, - this.renderInteractiveForms, - this.l10n, - /* enableScripting */ null, - /* hasJSActionsPromise = */ null, - /* mouseState = */ null - ); + this.annotationLayer = + this.annotationLayerFactory.createAnnotationLayerBuilder( + div, + pdfPage, + /* annotationStorage = */ null, + this.imageResourcesPath, + this.renderInteractiveForms, + this.l10n, + /* enableScripting */ null, + /* hasJSActionsPromise = */ null, + /* mouseState = */ null + ); } this._renderAnnotationLayer(); } @@ -632,9 +637,8 @@ class PDFPageView { }); }; this.eventBus._on("textlayerrendered", this._onTextLayerRendered); - this.structTreeLayer = this.structTreeLayerFactory.createStructTreeLayerBuilder( - pdfPage - ); + this.structTreeLayer = + this.structTreeLayerFactory.createStructTreeLayerBuilder(pdfPage); } div.setAttribute("data-loaded", true); diff --git a/web/pdf_thumbnail_view.js b/web/pdf_thumbnail_view.js index 3967a921c..3295daf6e 100644 --- a/web/pdf_thumbnail_view.js +++ b/web/pdf_thumbnail_view.js @@ -313,9 +313,8 @@ class PDFThumbnailView { // the `draw` and `setImage` methods (fixes issue 8233). // NOTE: To primarily avoid increasing memory usage too much, but also to // reduce downsizing overhead, we purposely limit the up-scaling factor. - const { ctx, canvas, transform } = this._getPageDrawContext( - DRAW_UPSCALE_FACTOR - ); + const { ctx, canvas, transform } = + this._getPageDrawContext(DRAW_UPSCALE_FACTOR); const drawViewport = this.viewport.clone({ scale: DRAW_UPSCALE_FACTOR * this.scale, }); diff --git a/web/text_layer_builder.js b/web/text_layer_builder.js index a459d7bdf..f722515be 100644 --- a/web/text_layer_builder.js +++ b/web/text_layer_builder.js @@ -317,13 +317,8 @@ class TextLayerBuilder { if (!this.renderingDone) { return; } - const { - findController, - matches, - pageIdx, - textContentItemsStr, - textDivs, - } = this; + const { findController, matches, pageIdx, textContentItemsStr, textDivs } = + this; let clearedUntilDivIdx = -1; // Clear all current matches.