PDF.js v2.1.266 Release Notes
Release Date: 2019-02-16 // about 5 years ago-
🔄 Changes since v2.0.943:
#10187 Bump versions in
pdfjs.config
#10188 Hide the beta version button on the website if there is only a stable version
#10162 Normalize BBox of form XObjects in SVG back-end
#10185 Reduce the number of redundant text normalization operations inPDFFindController
#10182 Small clean-up of the search related methods inTextLayerBuilder
#10184 Ensure that matches are not scrolled into after the findbar has been closed (PR 10100 follow-up)
#10196 [Regression] Ensure that "Highlight All" is propagated to all pages for 'findagain' events where the findbar was previously closed (PR 10100 follow-up)
#10190 Add a helper method for_getVisiblePages
, inBaseViewer
, for the case where only a single page is displayed in the viewer
⚡️ #10201 Reduce the number of redundantupdatetextlayermatches
events dispatched when calculating matches inPDFFindController
#10203 ChangecanvasInRendering
to aWeakSet
instead of aWeakMap
🚚 #10096 Remove theattachDOMEventsToEventBus
functionality, sinceEventBus
instances are able to re-dispatch events to the DOM (PR 10019, bug 1492849 follow-up)
⏪ #10202 Attempt to clean-up/restore pending rendering operations onRenderTask.cancel
(issue 10200)
#10217 For repeated 'findagain' operations, attempt to reset the search position if the user has e.g. scrolled in the document (issue 4141)
📜 #10219 Convertsrc/core/ps_parser.js
to use ES6 classes
#10228 Don't detect nw.js as node.js
#10233 [api-minor] ConvertPDFObjects
, insrc/display/api.js
, to an ES6 class
🚚 #10238 Move theinterface
definitions out ofsrc/core/worker.js
and into their own file
⚡️ #10245 UpdateBaseViewer.scrollPageIntoView
to always validate thepageNumber
parameter
#10223 When the search query changes, regardless of the search command, always re-calculate matches (bug 1030622)
#10220 Only scroll search results into view as a result of an actual find operation, and not when the user scrolls/zooms/rotates the document (bug 1237076, issue 6746)
#10231 Stop scrolling the document when "Highlight All" is toggled in the findbar (issue 5561)
#10244 Fix webpack example
#10255 Avoid unnecessaryPDFFindController.scrollMatchIntoView
calls inTextLayerBuilder._renderMatches
whenhighlightAll
is set (PR 10201 follow-up)
#10256 Attempt to tweak the error messages, inBaseViewer
, for invalid pageNumbers/pageLabels (bug 1505824)
⚡️ #10264 Update translations and packages
#10197 Usespan
instead ofdiv
in the text layer
#10246 Convert the remaining code insrc/display/api.js
to use ES6 classes
#10274 Fallback to an exhaustive search, in corrupt PDF files, for NameTrees/NumberTrees that are not correctly ordered (issue 10272)
👕 #10294 Add ESLint plugin import to be warned against invalid paths
#10292 Replace uglify-es with Terser
⬆️ #10293 Upgrade to Babel 7
#10275 FixNameOrNumberTree.get
to actually perform a binary search to find the requested key
⚡️ #10299 Update packages and translations
⚡️ #10300 Include forgotten changes after Wintersmith update
🏗 #10318 InGENERIC
builds, dispatch a "webviewerloaded" event (from thewebViewerLoad
function) before initializing the viewer
🚚 #10322 Remove unuseful variable
✅ #10323 Test the code as-is, in Node.js/Travis, rather than its Babel translated version
👍 #10340 Tweak thePDFHistory._tryPushCurrentPosition
method to work better with the different Scroll/Spread viewer modes
#10330 Handle line width of zero in SVG
#10304 Add protection against directory traversal attacks
⚡️ #10295 Update eslint-plugin-mozilla to 1.0.1
👕 #10337 Turn on ESLint in examples
#10351 Attempt to ignore mouse wheel zooming during tab switches (bug 1503412)
👍 #10350 Ignore thefieldValue
for Signature annotations, since they're currently unsupported (issue 10374)
✅ #10354 Disable source-map generation when running tests
#10356 Use high DPI icons on semi-high DPI screens.
#10358 Add keyboard shortcut to toggle sidebar (F4, same as Adobe Reader).
⬆️ #10266 Upgrade to Gulp 4
#10363 Fix small visual quirk in thumbnail viewer
📇 #10346 [api-minor] Add support, ingetMetadata
, for custom information dictionary entries (issue 5970, issue 10344)
#10369 [api-minor] Change thegetViewport
method, onPDFPageProxy
, to take a parameter object rather than a bunch of (randomly) ordered parameters
⚡️ #10375 Update translations and packages
👍 #10334 [api-minor] Add support for OpenAction destinations (issue 10332)
⚡️ #10378 Update remaining examples, and docs, to utilize current API functionality (issue 10377)
#10376 Convertsrc/core/chunked_stream.js
to ES6 syntax
#10392 Check that the first page can be successfully loaded, to try and ascertain the validity of the XRef table (issue 7496, issue 10326)
⚡️ #10394 Optimize theRef
class insrc/core/primitives.js
#10393 Convertsrc/core/document.js
to ES6 syntax
#10396 Optimizations to avoid intermediate string creation
💅 #10397 Ensure thatAnnotationBorderStyle.setWidth
is able to handle the input being aName
, to correctly deal with corrupt PDF documents (issue 10385)
#10398 Prevent errors in various methods inSimpleDOMNode
when thechildNodes
property is not defined (issue 10395)
#10277 Repair CFF fonts if stem hints are in wrong order
🚚 #10404 Remove thefor ... of
loop from thePDFDocument.fingerprint
getter (issue 10401)
#10399 migrate to canvas 2.x api
💅 #10411 Adjust howAnnotationBorderStyle.setWidth
handles the input being aName
(issue 10385)
📜 #10408 Prevent errors, because of incorrect scope, in theXMLParserBase._resolveEntities
method (issue 10407)
📜 #10412 Prevent errors, inSimpleXMLParser.onEndElement
, when the stack has already been completely parsed (issue 10410)
#10417 Fix reading number of HTMX metrics.
📚 #10420 Update translations/packages and improve documentation
#10421 Switch to HTTPS for the license link on the website
#10422 Convert more files insrc/core
to ES6 syntax
🖨 #10424 Accept non-matching document fingerprints, inPDFHistory
, when the viewer is reloaded (issue 6847)
⚡️ #10423 Add support for updating the document hash, off by default, when the browser history is updated (issue 5753)
#10441 Handle more cases of corrupt PDF files with missing 'endobj' operators, where the "obj" string is immediately followed by the dictionary (PR 9288 follow-up)
#10436 Avoid truncating inline images, where the data and the "EI" marker is glued together (issue 10388)
✅ #10425 Write more unit tests for the find controller
🚚 #10444 Remove left-over console log from the find controller unit tests
#10447 Handle malformed URIs as bad requests in the development webserver
#10443 PreventTypeError: views[index] is undefined
being throw ingetVisibleElements
when the viewer, or all pages, are hidden
#10462 Tweak theDOMTokenList.toggle
polyfill (issue 10460)
⚡️ #10461 Avoid setting incorrect document URLs, in IE 11, when the browser history is updated (PR 10423 follow-up)
📇 #10457 When parsing Metadata, attempt to remove "junk" before the first tag (PR 10398 follow-up)
🔨 #10466 Move/refactor the code in theBaseViewer.update
method to reduce duplication in the extending classes
#10467 Convert some usage ofindexOf
tostartsWith
/includes
where applicable
📇 #10471 Implement a unit test for metadata parsing to ensure that it's not vulnerable to the billion laughs attack
🏗 #10470 Try to, completely, avoid loading theReadableStream
polyfill in MOZCENTRAL builds
🚚 #10473 Add anArray.from
polyfill, using core-js, and remove some compatibility hacks from thesrc/display/content_disposition.js
file
⚡️ #10474 Update translations and packages
#10480 [Regression] Fix theFontInspector
in the PDFBug debugging tools
⚡️ #10483 Update themobile-viewer
example to use the newPDFHistory.initialize
format (PR 10423 follow-up)
🏗 #10484 Stop bundling theReadableStream
polyfill in MOZCENTRAL builds (PR 10470 follow-up)
#10492 Ensure thatXRef.indexObjects
can handle object numbers with zero-padding (issue 10491)
#10482 Implement Decode entry in Indexed images
0️⃣ #10494 Reduce unnecessary duplication of theisDefaultDecode
methods onColorSpace
instances
👕 #10489 Move more code/methods intoBaseViewer
, and simplify thePDFSinglePageViewer._scrollIntoView
method slightly
#10501 IngetVisibleElements
, checkfirstVisibleElementInd
rather thannumViews
before backtracking (PR 10443 follow-up)
⏪ #10499 Attempt to clean-up/restore pending rendering operations when errors occurs while aRenderTask
runs (PR 10202 follow-up)
👕 #10504 Enable theno-useless-catch
ESLint rule
#10508 Do the final text scaling correctly influshTextContentItem
(issue 8276)
#10515 Add asettled
property, tracking the fulfilled/rejected stated of the Promise, tocreatePromiseCapability
🚚 #10517 [api-minor] Remove thedocument.currentScript
polyfill
0️⃣ #10502 Modify a number of the viewer preferences, whose current default value is0
, such that they behave as expected with the view history
#10525 Convert more code to useclassList.toggle
with theforce
parameter
🚚 #10527 Add a polyfill forclassList.{add, remove}
with more than one parameter
#10532 Bump base version and version prefix inpdfjs.config
#10533 Bump the version number inpdfjs.config
🚀 #10534 Try to hack-around the brokenpdfjs-dist
links, such that they will point to the main library releases (issue 10391)
#10530 Fix copying on supplementary plane characters
#10545 Undo thepdfjs.config
version bumps
✅ #10537 Improve unit test coverage
#10540 [Chrome extension] Add missing "type" entry for theviewOnLoad
preference in thepreferences_schema.json
file (PR 10502 follow-up)
#10539 [api-minor] Fallback to the built-in font renderer when font loading fails