PDF.js v2.6.347 Release Notes
Release Date: 2020-09-03 // over 4 years ago-
π This release features support for form filling (AcroForm) and layers (optional content). Moreover, the default viewer is redesigned to match Firefox's Photon design, TypeScript definitions are shipped and various performance improvements and bugfixes are included.
π Changes since v2.5.207:
π #11948 Bump versions in
pdfjs.config
and update the getting started page of the website for the new release
π #11958 [api-minor] Remove the deprecatedPDFDocumentProxy.getOpenActionDestination
method (PR 11644 follow-up)
#11967 Do not transform jpeg RGB components
#11964 Fix pdfjs-dist/webpack causing errors with certain configs
#11953 For #11838: trigger fallback bar after user clicks in pdf
#11972 Change theloadedChunks
property, onChunkedStream
instances, from an Array to a Set
#11963 Avoid calling Math.pow if possible.
#11974 A couple of small image caching/sending improvements
π #11976 Remove unused methods fromNetworkManager
, insrc/display/network.js
β #11978 Improve unit test coverage for primitives
#11977 Convert theRefSet
primitive to a proper class and use aSet
internally
π #11985 Convert someObject
s toMap
s inChunkedStreamManager
, and move theisEmptyObj
helper function to the test utils
β‘οΈ #11987 UpdateSVGGraphics
to account for globally cached images (PR 11912 follow-up)
#11992 Prevent the (old) preprocessor from appending trailing whitespace when removing closing HTML comments
#11993 Change thedependencies
property, onOperatorList
instances, from an Object to a Set
π #11969 For #11961: collect telemetry on all unique unsupported features thatβ¦
π #11997 Add basic support for the nullish coalescing operator??
β‘οΈ #11999 Update packages and translations
π #12000 Ensure thatPDFImage.buildImage
won't accidentally swallow errors, e.g. from ColorSpace parsing (issue 6707, PR 11601 follow-up)
#12001 Add local caching ofColorSpace
s, by name, inPartialEvaluator.getOperatorList
(issue 2504)
#12002 Small improvements inCFFCompiler.encodeNumber
andCFFCompiler.encodeFloat
π· #12004 Convert the code insrc/core/worker.js
to use ES6 classes
π #12005 Convert the code insrc/core/cff_parser.js
to use ES6 classes
#12017 Convert thePDFPageProxy.intentStates
property from anObject
to aMap
#12016 Tweak theQueueOptimizer
to recognizeOPS.paintImageMaskXObject
operators as repeated when the "skew" transformation matrix elements are non-zero (issue 8078)
π #12021 Move thefetchBuiltInCMap
method to thePartialEvaluator.prototype
π #12012 Improve (local) caching of parsedColorSpace
s (PR 12001 follow-up)
β‘οΈ #12024 Update Needle to 2.5.0 or greater.
#12028 Attempt to detect inline images which contain "EI" sequence in the actual image data (issue 11124)
β‘οΈ #12032 Update packages and translations
#12041 Replace Mozilla Labs by just Mozilla
π #12049 Enable theno-promise-executor-return
ESLint rule
#12036 Add at least some test-coverage for theRenderTask.onContinue
functionality
β #12043 Add a reduced test-case for issue 4260 (PR 4521 follow-up)
#12044 Adjust the heuristics used when dealing with rectangles, i.e.re
operators, with zero width/height (issue 12010)
#12040 Replace non-inclusive "whitelist" term with "allowlist"
0οΈβ£ #12039 [api-minor] Use theNodeCanvasFactory
/NodeCMapReaderFactory
classes as defaults in Node.js environments (issue 11900)
#12034 Add local caching ofFunction
s, by reference, in thePDFFunctionFactory
(issue 2541)
#12057 AllowBaseLocalCache
to, optionally, only allocate storage for caching of references (PR 12034 follow-up)
#12059 Convert the code insrc/core/image.js
to use ES6 classes
#12060 Convert the code insrc/core/evaluator.js
to use standard classes
#12072 Bump npm from 6.14.5 to 6.14.6
π¨ #12056 Refactor/simplify the "delayedFallback" handling in the default viewer
π #12070 Re-factor theidFactory
functionality, used in thecore/
-code, and move thefontID
generation into it
π #12083 Remove the IR (internal representation) part of the ColorSpace parsing
#12063 Tweak the heuristic, insrc/core/jpg.js
, that handles JPEG images with a wildly incorrect SOF (Start of Frame)scanLines
parameter (issue 10989)
β‘οΈ #12092 Update packages and translations
π #12090 Stop special-casing the (very unlikely) "no/XObject
found"-scenario, when parsingOPS.paintXObject
operators, inPartialEvaluator.{getOperatorList, getTextContent}
#12099 Use aRefSet
, rather than a plain Object, for tracking already processed nodes inPartialEvaluator.hasBlendModes
#12085 Make the detection of Node.js environments on Electron strict.
#12089 ConvertRefSetCache
to a proper class and to use aMap
internally
#12087 Add local caching of "simple" Graphics State (ExtGState) data inPartialEvaluator.{getOperatorList, getTextContent}
(issue 2813)
#12101 Add a newsize
getter andgetRawValues
method, toDict
instances, to simplify some code
π¨ #12023 Fix auto-rotate for printing landscape PDFs where the first page is also landscape
π #12114 Remove a couple of unnecessaryPDFJSDev
checks from the viewer
#12106 [api-minor] Add an annotation storage in order to save annotation data in acroforms
β‘οΈ #12122 Update packages and translations
β #12124 Include the browser name when printing unit-test results
β #12126 Attempt to reduce intermittent failures in the "cleans up document resources during rendering of page" unit-test
β #12125 Improve test bot stability
#12127 Improve how Type3-fonts with dependencies are handled
π #12135 [src/core/worker.js] Remove a useless Promise handler from thepdfManagerReady
function
#12136 Ignorefetch()
errors, inPDFFetchStreamRangeReader
, once the request has been aborted
π¨ #12107 Add support for checkboxes printing
β #12143 Fix hanging reference test (PR 12107 follow-up)
#12141 Populate the find field with the search query when URL has #search hash
β #12147 [api-minor] Fix theAnnotationStorage
usage properly in the viewer/tests (PR 12107 and 12143 follow-up)
β #12144 PreventUncaught (in promise) AbortException
when running the unit-tests
βͺ #12148 Revert "Populate the find field with the search query when URL has #search hash"
#12131 [api-minor] Allow loading pdf fonts into another document.
βͺ #12151 Revert "[api-minor] Allow loading pdf fonts into another document."
β #12153 Unit test improvements
π¨ #12108 Add support for radios printing
#12102 Add types annotations
#12162 Tweak for the type of PageViewportParameters.viewBox (PR 12102 follow-up)
#12161 Add types to functions exported as API in src/pdf.js (PR 12102 follow-up)
#12157 Fix the type of SVGGraphics (PR 12102 follow-up)
π· #12160 Use typedef to define the type of GlobalWorkerOptions (PR 12102 follow-up)
π #12095 Add support for optional marked content.
π #12156 Improve the types generation and API documentation (PR 12102 follow-up)
#12163 Re-factor the dispatching of "attachmentsloaded" events, when the PDF document contains no "regular" attachments
β #12171 Attempt to reduce intermittent failures in the "multiple render() on the same canvas" unit-test
π #12168 Fix thegulp types
task to run on Windows, and place the TypeScript definitions correctly inpdfjs-dist
#12172 Fix the type definition of TypedArray. (PR 12156 follow-up)
π¨ #12174 Do theAppOptions.get("printResolution")
lookup once inweb/app.js
, when initializingPDFPrintServiceFactory
-instances, rather than for every printed page
#12173 [api-minor] Fix theannotationStorage
parameter inPDFPageProxy.render
π #12179 Add support forObject.fromEntries
#12169 Extract common methods fromPDFOutlineViewer
/PDFAttachmentViewer
into a new abstractBaseTreeViewer
class
π¨ #12175 Support textfield and choice widgets for printing
#12182 Fix the type of PDFDocumentLoadingTask.destroy.
#12154 [api-minor] Allow loading pdf fonts into another document.
β #12187 Add a test-case for issue 4398
β‘οΈ #12188 Update packages and translations
π¨ #12176 Support multiline textfields for printing
π¨ #12177 Support comb textfields for printing
#12186 Fix bad truetype loca tables.
#12192 A couple of (small) tweaks of theAnnotationStorage
(PR 12173 follow-up)
π¨ #12193 Setdirection: ltr;
on the canvases used during printing (bug 1335712)
π #12191 Remove thedisableCreateObjectURL
option fromweb/app_options.js
π #12137 Add support for saving forms
0οΈβ£ #12201 Enable renderInteractiveForms by default.
#12211 Wait until saving has finished before resettingPDFViewerApplication._saveInProgress
(PR 12137 follow-up)
#12212 Bug 1643508 - Disable touch-based pinch zooming on pdf.js.
#12210 Keep the original class/function names when minifying code (issue 12209)
π #12203 Bug 1392361 - Fix zooming sensitivity on macOS
π #12219 Add (basic) support for transfer functions to Images (issue 6931, bug 1149713)
#12227 Includeimage_decoders-es5
/minified-es5
in thepdfjs-dist
library (issue 12220)
#12229 Dispatch event when annotations have finished rendering.
β #12230 Implement reference testing for printing
β‘οΈ #12250 Update the zoom dropdown width calculation to work better in locales with long zoom-strings (PR 11077 follow-up)
#12251 Return the query with the findcontrolstate
#12241 confirm if leaving a modified form without saving
π #12248 Support file save triggered from the Firefox integrated version.
π #12247 Improve the field value parsing for choice widgets to handlenull
values
π #12256 #12241 followup - move event listener to PDFViewerApplication.load
π· #12244 fix webpack config problem caused by breaking changes of worker-loader
#12260 Replace menu dropdown icon
0οΈβ£ #12261 Also enablerenderInteractiveForms
by default in the viewer components (PR 12201 follow-up)
π¨ #12265 Don't warn when navigating away from a modified form, if printing has occurred (issue 12262)
β‘οΈ #12267 Update packages and translations
π¨ #12263 Fix AcroForm printing/saving edge cases
#12268 Reduce the leading padding for thenumPages
span (PR 11077 follow-up)
#12270 Accent positioning in Type1seac
glyphs
π· #12276 Access theXRef
/Catalog
data correctly in the "GetStats"/"GetPageIndex" handlers insrc/core/worker.js
#12271 Improve AcroForm/XFA form type detection
#12285 Ensure that thesourceEventType
parameter is actually optional inPDFViewerApplication.{download, save}
(PR 12248 follow-up)
#12286 Use a link, rather thanwindow.open
, when opening PDF attachments in Firefox (bug 1661259)
#12293 Download, rather than opening, PDF attachments in Firefox (bug 1661259, PR 12286 follow-up)
#12287 Bug 1661226 - Push button are not rendered with renderInteractiveForms enabled
#12298 Tweak the vertical positions of thefindbar
andsecondaryToolbar
(PR 11077 follow-up)
#12259 Fix handling of symbolic fonts and unicode cmaps.
#12300 Fix various :hover effects in the findbar (PR 11077 follow-up)
β‘οΈ #12299 Update the indeterminate progressBar to the new design (PR 11077 follow-up)
π #12170 [api-minor] Add support for toggling of Optional Content in the viewer (issue 12096)
π #12301 Add (basic) support for Stylelint, to allow linting of CSS files
π #12296 Add support, inDict.merge
, for merging of "sub"-dictionaries
π¨ #12310 Add support for /Print and /SaveAs named actions in the viewer (issue 12308)
π¨ #12315 print: Make the firefox printing code able to fail and be re-invoked.
#12321 Ensure that theviewer
property, onBaseViewer
-instances, is a valid div-element (issue 12320)
Previous changes from v2.5.207
-
π This release features performance improvements thanks to improved image caching and JPEG decoding.
π Changes since v2.4.456:
π #11717 Bump versions in
pdfjs.config
and update the getting started page of the website for the new release
π #11719 Remove the unusedwideChars
property onFont
instances
β‘οΈ #11720 Update theeslint-plugin-no-unsanitized
package to the latest version
β‘οΈ #11721 Don't let Travis runnpm update
during setup
π #11728 Remove unnecessary checks from thePDFDocumentProperties
constructor
π #11724 Only build the necessaryweb/
files during thegulp default_preferences
task
π #11723 Remove variable shadowing from the JavaScript files in thesrc/display/
folder
#11725 Re-factorPDFViewerApplication.load
such that{PDFViewer, PDFThumbnailViewer}.setDocument
happens slightly earlier
π #11734 Remove old API methods which were previously converted to throwing (PR 11219 follow-up)
#11736 Addpassive: false
to thewheel
event listener used inPDFPresentationMode
(issue 11735, PR 10765 follow-up)
π #11742 Remove variable shadowing from the JavaScript files in thetest/unit/
folder
π #11738 Remove variable shadowing from the JavaScript files in thesrc/core/
folder
#11707 Always prefer the PDF.js JPEG decoder for very large images, in order to reduce peak memory usage (issue 11694)
#11744 The first glyph in CFF CIDFonts must be named 0 instead of ".notdef"
π¨ #11646 Ensure that automatic printing still works when the viewer and/or its pages are hidden (bug 1618621, bug 1618955)
#11747 Addpassive: false
when removing wheel listeners
π #11745 Enable the ESLintno-shadow
rule
π #11755 Remove the unusedsizes
andencoding
properties onFont
instances
#11767 Replace the RTL images with CSS transforms of the standard images (issue 11766)
π #11655 [api-minor] Remove thegetGlobalEventBus
viewer functionality, and theeventBusDispatchToDOM
option/preference (PR 11631 follow-up)
π #11771 Fail early, in modernGENERIC
builds, if certain required browser functionality is missing (issue 11762)
β‘οΈ #11772 Update packages and translations
#11769 Ensure thatFont.charToGlyph
won't fail becauseString.fromCodePoint
is given an invalid code point (issue 11768)
β‘οΈ #11781 Update the "gulp jsdoc" task to account for API changes in themkdirp
package (PR 11772 follow-up)
π #11780 Move the initialization of "page labels"/"metadata"/"auto print" out ofPDFViewerApplication.load
#11773 [api-minor] ChangeFont.exportData
to use an explicit white-list of exportable properties, and stop exporting internal/unused properties
0οΈβ£ #11777 [api-minor] ChangeFont.exportData
to, by default, stop exporting properties which are completely unused on the main-thread and/or in the API (PR 11773 follow-up)
#11746 Create the glyph mapping correctly for composite Type1, i.e. CIDFontType0, fonts (issue 11740)
#11727 Add a heuristic to scale even single-char text, when the horizontal/vertical scaling differs significantly (issue 11713)
0οΈβ£ #11789 Add a newpdfjs.enablePermissions
preference, off by default, to allow the PDF documents to disable copying in the viewer (bug 792816)
#11797 Don't bundle the fallbackgrab
/grabbing
cursor images when runninggulp mozcentral
π #11799 Fail early, in modernGENERIC
builds, if certain required browser functionality is missing (PR 11771 follow-up)
π #11800 Remove any mention of Gitpod from the README (issue 11732)
β‘οΈ #11809 Update Prettier to version 2.0
#11806 [api-minor] Fix the return value ofPDFDocumentProxy.getViewerPreferences
when no viewer preferences are present (PR 10738 follow-up)
#11810 A couple of smallString.fromCodePoint
improvements (PR 11698 and 11769 follow-up)
#11805 Always skip over any additional, unexpected, RSTx (restart) markers in corrupt JPEG images (issue 11794)
π» #11813 Suppress browser autofill on page number
π #11821 docs: Fix simple typo, occurences -> occurrences
π #11819 [src/core/jpg.js] Remove redundant marker validation at the end of thedecodeScan
function (PR 11805 follow-up)
π #11818 Enable thedot-notation
ESLint rule
π #11814 Support the vertical writing mode with SVG backend.
β‘οΈ #11822 Update packages and translations
π #11826 Change the "download" keyboard shortcut (Ctrl+S) handling, in GENERIC/CHROME builds, to utilize theEventBus
(issue 11657); add a new "openfile" keyboard shortcut (Ctrl+O), in GENERIC builds
#11823 [src/core/fonts.js] Improve thevalidateOS2Table
function and other code
π #11825 Avoid reading the "disablePreferences"/"locale" options, when initializing the viewer, in extension builds
π #11831 Use Node LTS releases to fix Travis CI builds (issue 10790)
#11835 [api-minor] ChangePageViewport
to throw when therotation
is not a multiple of 90 degrees
#11837 Always attempt to dispatch the "webviewerloaded" event at the embeddingdocument
(PR 10318 follow-up, issue 11829)
π #11844 [api-minor] Immediately release thefont.data
property once the font been attached to the DOM (PR 11777 follow-up)
π #11845 Use the nativeURL.createObjectURL
method more in theweb/
folder
π #11847 Move themaybeValidDimensions
check, used with JPEG images, to occur earlier (PR 11523 follow-up)
β #11807 Introduce Puppeteer for handling browsers during tests
#11853 Include the name for interactive form elements
π #11834 Preserve error types during translation
π #11864 Remove thecreate-react-app
example (issue 11729)
β‘οΈ #11868 Update packages and translations
#11869 Various smaller clean-up ingulpfile.js
π #11863 Add more categories of unsupported features.
π #11872 Gracefully handle annotation parsing errors inPage.getOperatorList
(issue 11871)
π #11879 Enable the ESLintgrouped-accessor-pairs
rule
π #11873 Use the ESLintno-restricted-syntax
rule to ensure thatassert
is always called with two arguments
#11880 Attempt to respect the "zoom" hash parameter, even when the "nameddest" parameter is present (issue 11875)
π #11889 Handle errors individually for each annotation in the_parsedAnnotations
getter
β‘οΈ #11890 Update ESLint to version 7
#11892 Add aminified-es5
gulp task (issue 11858)
#11905 Reduce the usage ofrequire
statements in code-paths not protected by pre-processor and/or run-time checks
β‘οΈ #11910 Update packages and translations
π #11911 Remove the SystemJS dependency from theweb/preferences.js
file
π» #11917 [Firefox] Allow PDF attachments to, once again, be opened directly in the browser (bug 1632644)
π· #11914 Convert thesrc/pdf.js
andsrc/pdf.worker.js
files to use standardimport
/export
statements
#11919 Reduce usage of SystemJS, in the development viewer, even further
#11912 Attempt to cache repeated images at the document, rather than the page, level (issue 11878)
π· #11924 Avoid hanging the worker-thread for CMap data with ridiculously large ranges (issue 11922)
π #11926 AllowGlobalImageCache.clear
to, optionally, only remove the actual data (PR 11912 follow-up)
#11601 [api-minor] Decode all JPEG images with the built-in PDF.js decoder insrc/core/jpg.js
#11927 Implement fill opacity for shading patterns in the SVG back-end
β‘οΈ #11939 Update Acorn to version 7
#11940 Add comments to theexport
list in thesrc/pdf.js
file (PR 11914 follow-up)
#11930 Improve the local image caching inPartialEvaluator.getOperatorList
π #11943 Remove unused code from theexternal/builder/builder.js
file
β‘οΈ #11945 Update packages and translations
#11947 Ensure that that we don't attempt to cache inline images in theGlobalImageCache
(PR 11912 follow-up)