PDF.js v2.3.200 Release Notes

Release Date: 2019-10-03 // 5 months ago
  • 🔄 Changes since v2.2.228:

    #10960 Bump versions in pdfjs.config
    #10963 Ensure that PDFViewerApplication.{zoomIn, zoomOut} won't run when PesentationMode is active (PR 10652 follow-up)
    🚚 #10959 Remove the data-pdfjsprinting attribute on the <body> when destroying FirefoxPrintService/PDFPrintService instances (issue 10948)
    #10962 Prevent "Uncaught promise" messages in the console when cancelling TextLayer tasks (PR 10601 follow-up)
    #10964 Bump lodash from 4.17.10 to 4.17.14
    🚚 #10958 Remove the intentState.receivingOperatorList boolean since it's redundant
    #10850 Scale stroking line width when using a tiling pattern.
    #10851 Apply bounding box before using shading patterns.
    🏁 #10950 Fixed testing webserver to handle paths correctly on Windows
    #10966 Add timestamp to the page rendered event.
    🚚 #10968 Remove useless wrapReason calls in the MessageHandler class
    #10970 Simplify, and inline, the finalize function in the MessageHandler class
    #10969 Add an API unit-test for the stopAtErrors option (PRs 8240 and 8922 follow-up)
    🖨 #10974 Simplify the PDFDocument.fingerprint method slightly
    📜 #10820 Annotations - Added parsing of IRT, RT, State and StateModel
    #10987 Bump js-yaml from 3.12.0 to 3.13.1
    ♻️ #10990 Refactor the onBeforeDraw/onAfterDraw functionality used in BaseViewer and PDFPageView
    #10979 [Firefox] Re-factor the 'zoomreset' message handling in the viewer (PR 10652 follow-up)
    #10986 Attempt to significantly reduce the number of ChunkedStream.{ensureByte, ensureRange} calls by inlining the this.progressiveDataLength checks at the call-sites
    #10993 Add the docBaseUrl API parameter to AppOptions in the viewer
    🚚 #10995 Remove an unnecessary PDFDocumentProperties.setFileSize call, relevant for the Firefox built-in viewer, and use the "normal" code-path in PDFViewerApplication.open instead
    📜 #11001 Inline the isCmd check in the Parser.shift method
    #10996 Avoid creating a PDFFindBar instance, in the Firefox built-in viewer, when not actually necessary
    👍 #11003 Ensure that setting the zoomDisabledTimeout isn't skipped, regardless of the supported zoom keys, when handling mouse wheel events (PR 7097 follow-up)
    #11012 Reduce the number of function calls in EvaluatorPreprocessor.read
    #11019 Decode URL encoded filenames from content disposition headers
    #11020 Add a work-around, in glyphlist.js, for bad PDF generators which use a non-standard /f_f string in the Encoding dictionary when referring to the ff ligature (issue 11016)
    #11033 Ensure that the loading indicator, in the pageNumber input, is hidden when the viewer is closed
    ⚡️ #11029 [api-minor] Update telemetry to use 'categorical' histograms.
    #11034 Ensure that ReadableStreams are cancelled with actual Errors
    #11038 [api-minor] Fix completely broken getStats method by returning stats in Objects, rather than in Arrays (PR 11029 follow-up)
    #11013 [api-minor] Implement quadpoints for annotations in the core layer
    #11048 Use more compact keys in PDFLinkService._pagesRefCache
    #11049 Add page rendered timestamp to telemetry.
    👍 #11047 Support corrupt PDF files with invalid/non-existent Group /CS entries (issue 11045)
    #11051 Actually compare the cropBox and mediaBox correctly in the Page.view getter
    #11057 Handle some corrupt/truncated JPEG images that are missing the EOI (End of Image) marker (issue 11052)
    #11059 Fallback gracefully when encountering corrupt PDF files with empty /MediaBox and /CropBox entries
    🌐 #11062 Miscellaneous small clean-up of code in the web/ folder
    #11064 Convert the src/shared/util.js file to ES6 syntax
    📜 #11070 Inline the isString check in the Parser.getObj method
    🚚 #11073 Move polyfill for codePointAt to String prototype.
    #11076 Replace the XRef.cache Array with a Map instead
    #11081 added in information about pdfjs/webpack
    💅 #11079 [TextLayer] Only cache the current textDiv style when enhanceTextSelection is enabled and use template strings in expandTextDivs
    #11087 Add a way to disable external links.
    #11086 [TextLayer] Only cache the originalTransform when enhanceTextSelection is enabled
    #11091 [TextLayer] Only handle positive padding values in expandTextDivs
    🏗 #11090 [TextLayer] Use an Array to build the total transform, rather than concatenating Strings, in expandTextDivs
    🖨 #11093 Shorthand afterPrint signature in app.js
    🏗 #11092 [TextLayer] Use an Array to build the total padding, rather than concatenating Strings, in expandTextDivs
    #11069 Use streams for OperatorList chunking (issue 10023)
    ⚡️ #11096 Update translations/packages and upgrade to eslint version 6
    #11095 Include a reduced, non-linked PDF file for the attachments API unit test
    #11097 [TextLayer] Only measure the width of the text, in _layoutText, for multi-char text divs
    #11102 Bump mixin-deep from 1.3.1 to 1.3.2
    ⚡️ #11104 [TextLayer] Avoid unnecessary font updates in _layoutText and remove setAttribute usage in appendText
    #11107 Various MessageHandler improvements when using Streams
    🚚 #11110 Remove support for the scope parameter in the MessageHandler.on method
    #11111 Inline the resolveCall helper function at its call-sites in MessageHandler
    🚚 #11112 Remove the API/Worker version warning message in TESTING mode
    #11108 Use more ES6 syntax in the annotation code
    #11115 Ensure that Errors are handled correctly when using postMessage with Streams in MessageHandler
    🚚 #11123 [api-minor] Remove the postMessageTransfers parameter, and thus the ability to manually disable transferring of data, from the API
    👷 #11118 Transfer, rather than copy, CMap data to the worker-thread
    ⚡️ #11127 Update the eslint-plugin-mozilla to the latest version (PR 10905 follow-up)
    #11129 Prevent "offsetParent is not set -- cannot scroll" errors when the viewer loads in e.g. a hidden <iframe>
    👕 #11133 Enable the no-async-promise-executor ESLint rule
    👷 #11130 Don't enqueue unused properties when sending 'GetOperatorList' data from the worker-thread (PR 11069 follow-up)
    #11138 [CRX] Ignore auto-generated from Chrome
    #11134 Ensure that addLinkAttributes is always called with a valid url parameter
    0️⃣ #11142 Stop dispatching a "localized" event from the webL10n library, since it's unused and may clash with the default viewer
    👷 #11106 Abort, with a small delay, getOperatorList on the worker-thread when rendering is cancelled (PR 11069 follow-up)
    ⚡️ #11145 Update translations and packages
    #11155 Miscellaneous (small) clean-up of the MessageHandler code
    #11159 For Type1 fonts, replace missing font dictionary /Widths entries with ones from the font data (issue 11150)
    #11158 Avoid floating point inaccuracy in gradient color stops
    #11163 Fix the link in the doc website
    #11146 Replace our URL polyfill with the one from core-js
    👕 #11165 Enable a couple of return related ESLint rules
    ⚡️ #11168 Remove unmaintained localizations and update translations and packages
    #11171 Fix the inconsistent return types for Dict.{get, getAsync}
    📦 #11173 Replace the bundled ReadableStream polyfill with the web-streams-polyfill npm package (issue 11157)
    #11169 Reduce the number of function calls in the Dict class
    👻 #11185 Convert the various ...Exceptions to proper classes, to reduce code duplication
    👷 #11182 Forbid sending of Dicts and Streams, with postMessage, when workers are disabled
    👀 #11187 Convert the various image decoder ...Errors to classes extending BaseException (PR 11185 follow-up)


Previous changes from v2.2.228

  • #10557 Bump versions in pdfjs.config
    📇 #10556 [api-minor] Expose the existence of a Collection dictionary via the getMetadata API method (issue 10555)
    ⚡️ #10554 Simplify the updatetextlayermatches event handling in TextLayerBuilder
    0️⃣ #10548 Generate the default_preferences.json file from AppOptions
    #10558 Re-factor the PDFDataRangeTransport unit-tests and enable them in Node.js/Travis
    ⚡️ #10560 Update translations and packages
    #10579 Re-factor the PDFSidebar constructor to simplify its call-site (PR 10123 follow-up)
    #10578 Try to temporarily hack around the __non_webpack_require__ bug, and update Webpack to the latest stable version (issue 10177)
    🚚 #10577 Move worker-thread only functions from src/shared/util.js and into a new src/core/core_utils.js file
    #10582 Use Promise.prototype.finally in the PDFRenderingQueue.renderView method
    #10589 Run the custom_spec unit-tests in Node.js/Travis (PR 10537 follow-up)
    #10585 Load built-in CMap files using the Fetch API when possible
    #10573 Avoid truncating/breaking some Type3 glyphs in compileType3Glyph (bug 1245391, issue 10568)
    ⚡️ #10599 Update Webpack to the latest stable version (4.29.6)
    #10597 Ensure that the temporary canvas created in CanvasGraphics.isFontSubpixelAAEnabled will be cleared
    #10595 Zero the width/height of the temporary canvas used during JpegDecode (issue 10594)
    #10591 Add unique glyph names for CFF fonts.
    #10601 Zero the width/height of the temporary canvas used during TextLayer rendering
    #10604 Put the string name of the glyph in the charset array.
    ⚡️ #10606 Update translations and packages
    🚚 #10590 Fix missing moveTos in SVG paths
    👷 #10608 Reduce usage of Date.now() in src/core/worker.js
    0️⃣ #10610 Add type validation to the default_preferences generation (PR 10548 follow-up)
    #10605 Convert let to const if possible in, and improve unit test coverage for, src/display/display_utils.js
    #10615 Handle corrupt ASCII85Decode inline images with whitespace "inside" of the EOD marker (issue 10614)
    #10621 Don't scale SVG stroke width by text matrix
    🚚 #10634 Move NativeImageDecoder into a separate file, and convert it to a class
    #10633 Convert MurmurHash3_64 to an ES6 class
    0️⃣ #10628 Try to improve text-selection for Type3 fonts that utilize a non-default /FontMatrix (bug 1513120)
    #10636 Small clean-up of the PDFDocumentProxy.destroy method and related code
    #10647 Actually transfer eligible ImageMask data, rather than always copying it
    #10644 Ensure that blob: URLs will be revoked when pages are cleaned-up/destroyed (JPEG memory usage)
    #10646 Implement linear-gradient, radial-gradient and dummy-pattern in SVGGraphics.
    #10635 Convert src/core/parser.js to ES6 syntax and write more unit tests for the lexer and the parser
    ⚡️ #10657 Update test case description
    💻 #10652 Prepare the MOZCENTRAL viewer for receiving zoom events from the browser UI (bug 786674, bug 1177385)
    🚚 #10668 Remove the Firefox-specific 'read with streaming' unit-test
    #10681 fix: electron enviroment detection
    #10685 Take the FirstChar/LastChar properties into account when computing the hash in PartialEvaluator.preEvaluateFont (issue 10665)
    #10683 Use CMap in Type0 fonts when CFF is not a CID font
    #10692 Add Mozilla Code of Conduct
    ⚡️ #10698 Update translations/packages and include the code of conduct for pdfjs-dist too
    #10706 Add missing hasChildNodes polyfill to domstubs.js (PR 10022 follow-up)
    #10675 [Firefox regression] Fix disableRange=true bug in PDFDataTransportStream
    🏗 #10713 Remove src/core/annotation.js from the gulp jsdoc build target
    🚚 #10678 Remove moz-chunked-arraybuffer support, and related code, from src/display/network.js
    👍 #10709 [api-minor] Add basic support for PageLayout in the API and the viewer
    ⚡️ #10714 [Firefox] Ensure that loading progress is reported, and the loadingBar updated, when disableRange=true is set
    #10674 Convert src/display/svg.js to ES6 syntax and implement setRenderingIntent and setFlatness for the SVG backend
    #10715 Add test for fetch_stream
    #10725 Attempt to clarify the l10n section of CONTRIBUTING.md
    #10723 [api-minor] Implement caret annotations
    #10728 Annotations - _preparePopup method replaced with MarkupAnnotation
    ⚡️ #10696 Update ChunkedStream.makeSubStream to actually check if (some) data exists when the length parameter is undefined
    #10694 Avoid dispatching range requests to fetch PDF data that's already loaded with streaming (PR 10675 follow-up)
    ⚡️ #10733 Update translations and packages
    🆓 #10735 [api-minor] Implement free text annotations
    #10742 [Firefox] Avoid displaying the indeterminate loadingBar when disableStream=true is set (PR 10714 follow-up)
    #10746 Add links to PDF.js homepage and API reference in README.md
    👍 #10727 Support (rare) Type3 fonts which contains image resources (issue 10717)
    #10754 Add a getDocId method to the idFactory, in Page instances, to avoid passing around PDFManager instances unnecessarily (PR 7941 follow-up)
    👍 #10738 [api-minor] Add support for ViewerPreferences in the API (issue 10736)
    0️⃣ #10765 Add passive: false to the wheel event listener, to work-around broken default behaviour in Chrome 73 and above (issue 10761)
    ⚡️ #10784 Ensure that the OperatorList constructor actually initializes a NullOptimizer when intended (PR 9089 follow-up)
    #10756 Attempt to handle corrupt PDF documents that contains path operators inside of text object (issue 10542)
    #10789 Change PartialEvaluator.handleColorN to throw when no valid pattern is found
    #10771 [api-minor] Implement creation/modification date for annotations
    ⚡️ #10795 Update the canvas npm package to fix Travis CI builds (issue 10790)
    👕 #10805 Enable the consistent-return ESLint rule
    #10794 Fix glyph at index zero in CIDFontType2 that has a CIDToGIDMap stream
    🚚 #10826 Remove unused ref property from the parameters object used when creating annotations in AnnotationFactory._create
    #10827 Convert the (remaining) network streams to ES6 classes
    🔧 #10854 make print resolution configurable via AppOptions
    #10833 [api-minor] Implement contents and creation date for the correct annotation types
    ⚡️ #10859 Update translations and packages
    #10862 Add caching to reduce the number of Ref objects
    #10863 Ensure that the Cmd/Name/Ref caches are cleared when running other cleanup code
    #10869 Restore referrer preserving functionality in Chrome 72+
    #10867 Don't clip if path is undefined in SVG back-end
    #10872 Re-use, rather than re-creating, some Arrays when resetting them in src/display/api.js
    👷 #10873 Ensure that the Cmd/Name/Ref caches are cleared when terminating the worker (PR 10863 follow-up)
    #10877 Ignore Annotations with too large border widths, to prevent the annotationLayer from rendering it over the surrounding document (bug 1552113)
    🖨 #10879 [api-minor] Attempt to reduce memory usage during printing, by always running cleanup once rendering has finished
    0️⃣ #10890 Add support for outline items, in the default viewer, which default to collapsed when the outline is built
    🚚 #10897 Remove a superfluous linkService.isPageVisible check from PDFFindController (PR 10217 follow-up)
    🖨 #10898 Allow experimenting with the printResolution AppOption when printing with the built-in Firefox version
    👕 #10905 Pin the version of eslint-plugin-mozilla to prevent failures on Travis (issue 10901)
    🚚 #10903 Move PDFWorkerStream and related code to its own file
    📜 #10926 Change the signature of the Parser constructor to take a parameter object
    👕 #10925 Enable the eslint-plugin-no-unsanitized ESLint plugin to disallow unsafe usage of e.g. innerHTML
    #10902 Implement tiling patterns for the SVG back-end
    ⚡️ #10936 Update translations and packages
    #10938 Reduce the number of isCmd calls slightly in the XRef class
    #10937 Restore the header size limit of 80 KB
    #10947 Make the find helper function, in src/core/document.js, more efficient by using peekBytes rather reading the stream one byte at a time
    #10949 Delay initialization of searching, in the viewer, until the first page has rendered