npm pdfjs-dist 2.7.570
v2.7.570

latest releases: 4.7.76, 4.6.82, 4.5.136...
3 years ago

This release features improved performance, font rendering, annotation rendering and form rendering/saving/printing (AcroForm). Moreover, it includes initial support for scripting in a sandbox (disabled by default). Finally, support for IE 11 and non-Chromium-based Edge is dropped.

Changes since v2.6.347:

#12323 Bump versions in pdfjs.config
#12326 Revert "Download, rather than opening, PDF attachments in Firefox (bug 1661259, PR 12286 follow-up)"
#12330 Update packages and translations
#12329 Rename the --outline-... CSS variables to --treeitem-... instead (PR 11077 follow-up)
#12328 Remove code-paths only relevant for IE 11/Edge (non-Chromium based) from the web/ folder
#12331 [api-minor] Only support browsers/environments that have basic support for Promise natively
#12336 Remove, manually implemented, DOM polyfills only necessary for IE 11 support
#12269 Add support for missing appearances for hightlights, strikeout, squiggly and underline annotations.
#12339 Support broken /FitH destinations that are missing the "top" value (bug 1663390)
#12343 Remove some code/comments relevant for old (pre-Chromium) versions of Opera
#12344 Save form data in XFA datasets when pdf is a mix of acroforms and xfa
#12345 Don't try to save something for a button which is neither a checkbox nor a radio
#12354 Ensure that the container div, on BaseViewer-instances, is absolutely positioned
#12352 Remove CSS variables feature-testing from PDFSidebarResizer
#12356 Set the modification date to the current day when saving
#12349 Follow-up comments on PR #12344
#12357 PDF names need to be escaped when saving
#12360 Reset cursor position when focus is out of text field
#12362 Let the loadingBar have the same width as the viewerContainer
#12364 Dict keys need to be escaped too when saving
#12365 Ensure that the length property won't be accidentally accessed on a DecodeStream-instance
#12363 canvas: Properly restore all the remaining items in stateStack in endDrawing
#12368 Revert "canvas: Properly restore all the remaining items in stateStack in endDrawing"
#12372 Skip failing FBF tests, when running makeref, in Firefox as well
#12374 Replace \n and \r by \n and \r when saving a string
#12370 Implement resetting of created streams for annotations
#12361 Ensure that all necessary /Font resources are included when saving a WidgetAnnotation-instance (issue 12294)
#12377 Set parent of radio annotation even if there is no 'V' field
#12375 Ensure that the empty dictionary won't be accidentally modified, and slightly improve the "SaveDocument" handler in src/core/worker.js
#12369 canvas: fix restore() with existing SMask groups and re-land #12363.
#12388 Refactor the container/viewer checks in the BaseViewer constructor
#12387 Use the same kind of strings for radio values
#12393 Prevent errors if the InkList property, in InkAnnotations, is missing and/or not an Array (issue 12392)
#12396 Update packages and translations
#12397 Update the webpack-stream dependency (issue 11996)
#12414 Need to reset the streams when printing
#12409 Compute the transformOrigin correctly, for negative values, when rendering AnnotationElements (bug 1627030)
#12417 Remove the PDFPageView.{error, stats} properties, and some related viewer clean-up
#12405 Fixed keydown event handling problem with shadow DOM.
#12423 Update escodegen to version 2.0
#12422 Don't trigger searching, in the GENERIC viewer, when Shift is used together with the regular keyboard shortcut (issue 12421)
#12419 Use the cidToGidMap, if it exists, when building the glyph mapping for non-embedded composite fonts (issue 12418)
#12426 Re-factor how printing is triggered in the default viewer
#12439 Add version/build info at the top of the built web/viewer.js file
#12436 Enable the ESLint no-var rule in the src/shared/ folder
#12333 Add tooltip if any in annotations layer
#12437 Enable the ESLint no-var rule in the src/display/ folder
#12441 Re-factor how the ESLint no-var rule is enabled in the src/ folder
#12442 Upgrade Puppeteer to version 5.3.1
#12444 Update packages and translations
#12445 Upgrade minor/major versions of dependencies that don't require code changes
#12446 [Firefox] Stop logging RenderingCancelledExceptions as errors when printing
#12448 Enable the ESLint no-debugger and no-alert rules
#12450 Fix invalid XUID entries in CFF fonts
#12451 Upgrade acorn to version 8
#12454 Upgrade terser to version 5
#12458 Add local caching of TilingPatterns in PartialEvaluator.getOperatorList (issue 2765 and 8473)
#12470 Upgrade webpack to version 5
#12476 Remove the scope parameter from the "GetOperatorList" handler in src/core/worker.js (PR 11110 follow-up)
#12477 Handle WorkerTasks, and various PDF document properties, correctly in the "SaveDocument" handler in src/core/worker.js
#12429 [api-minor] Add the possibility to collect Javascript actions
#12479 Fix the "should get form info when AcroForm is present" unit-test
#12478 Convert PartialEvaluator.translateFont to an async method
#12486 Stop caching the parsed Font data on its Dict object (PR 7347 follow-up)
#12483 Don't store complex data in PDFDocument.formInfo, and replace the fields object with a hasFields boolean instead
#12481 Get urls if any in AA::D dictionary for pushbuttons
#12485 [api-minor] JS - Add a function in api to get the fields ids in AcroForm::CO
#12489 Add a test for pdfDocument::fieldObjects
#12491 Update packages and translations
#12493 Support adding pages, in addition to regular destinations, to the browser history and use it with thumbnails (issue 12440)
#12515 Enable the unicorn/no-abusive-eslint-disable ESLint plugin rule
#12503 [api-minor] Invalidate an annotation with no quadPoints (when it's required)
#12432 JS - Add the basic architecture to be able to execute embedded js
#12516 Prevent issues, in PDFDocument.fieldObjects, for invalid Annotations
#12526 Improve argument/name handling when parsing TilingPatterns (PR 12458 follow-up)
#12524 A couple of small (viewer) tweaks of tooltip-only Annotations (PR 12333 follow-up)
#12522 Fix a couple of edge-cases in PDFViewerApplication._initializeJavaScript (PR 12432 follow-up)
#12464 Fix getVisibleElements helper in RTL-locales
#12508 Fallback font for buttons must be ZapfDingbats.
#12528 Convert var to const/let in the test/unit folder
#12529 Tweak the pdf.scripting.js bundling, to improve overall consistency
#12527 Remove SystemJS usage from the development viewer and the unit-tests
#12534 Ensure that MurmurHash3_64.update handles ArrayBuffer input correctly, to avoid hash-collisions (issue 12533)
#12532 Modernize, and remove SystemJS usage from, the font-tests
#12540 Ensure that the same version of PDF.js is used in both the API and the Viewer (PR 8959 follow-up)
#12539 Use standard import statements more when running the unit-tests
#12395 Render not displayed annotations in using normal appearance when printing
#12542 Add a MurmurHash3_64.update unit-test for TypedArrays which share the same underlying ArrayBuffer (PR 12534 follow-up)
#12543 Use a Map, rather than an Object, internally in the Catalog.openAction getter (PR 11644 follow-up)
#12551 Fix some errors reported by the ESLint no-useless-escape rule
#12525 [api-minor] Implement API to get MarkInfo from the catalog.
#12552 Miscellaneous (small) improvements in src/core/annotation.js
#12560 Update npm packages
#12561 Fix some static analyzer warnings (issue 11965)
#12562 Try adding a very basic lgtm.yml file, to prevent LGTM complaining about unused variables (issue 11965)
#12555 Replace css color rgb(...) by #...
#12559 Also update the browser history when the user manually change pages using the pageNumber-input (PR 12493 follow-up)
#12505 [api-minor] Split highlight annotation div into multiple divs
#12572 Change the getVisibleElements helper function to take a parameter object
#12568 [api-minor] JS -- Add default value in annotation data
#12583 Add global caching, for /Resources without blend modes, and use it to reduce repeated fetching/parsing in PartialEvaluator.hasBlendModes
#12564 Make sure that Popup is rendered next to trigger for textAnnotation
#12530 JS -- Add 'util' object
#12591 Improve the Pattern-detection in CanvasGraphics.stroke
#12594 Enable the ESLint no-useless-escape rule (PR 12551 follow-up)
#12595 Convert files in the src/display/-folder to use optional chaining where possible
#12598 Fail early, in modern GENERIC builds, if globalThis isn't available (PR 11799 follow-up, issue 12596)
#12546 [api-minor] JS -- Add listener for sandbox events only if there are some actions
#12582 JS -- Implement doc object
#12585 Fix popup for highlights without popup (follow-up of #12505)
#12613 Trigger cleanup, once rendering has finished, in PDFThumbnailView.draw
#12616 Improve the cleanup functionality for thumbnails
#12618 Ensure that rendering of thumbnails work correctly on HiDPI displays (issue 9820)
#12621 Follow-up for #12585: set elements class in render instead of in _createQuadrilaterals
#12622 Some hasJSActions, and general annotation-code, related cleanup in the viewer and API
#12624 Update packages and translations
#12569 JS -- Fix events dispatchment and add tests
#12625 Add a new preference, viewerCssTheme, to allow forcing the use of the light/dark viewer CSS themes (issue 12290)
#12630 Reduce, now unnecessary, asynchronicity in the BasePreferences constructor
#12636 Add an AppOptions.setAll method, and use it in PDFViewerApplication._readPreferences
#12567 [api-minor] JS -- hidden annotations must be built in case a script show them
#12604 JS -- Add a sandbox based on quickjs
#12642 [api-minor] Add "contentLength" to the information returned by the getMetadata method
#12645 Convert the PDFDocumentProperties.open method to be async
#12647 Update Puppeteer to version 5.5.0
#12656 Bump highlight.js from 9.13.1 to 9.18.5
#12655 Parenthesis in names are not escaped when saving
#12662 Check the top-level /Pages dictionary when finding the trailer in XRef.indexObjects (issue 12402)
#12652 Add a README about quickjs-eval.js file (build and license)
#12665 Update packages and translations
#12666 Use the same SVG images, in the default viewer, regardless of the CSS theme
#12673 Split underline, strikeout, squiggly annotions div into multiple divs
#12631 JS -- Implement app object
#12679 Fix the treeitem-expanded/treeitem-collapsed images in dark-mode (PR 12666 follow-up)
#12681 Update the link for the "pr8808" test-case (issue 12680)
#12682 [Generic viewer] Re-factor how the notFound appearance is set on the "findInput" in the PDFFindBar
#12685 Fix issue #12684: replace bitwise ORs by ORs
#12693 [Regression] Prevent the built pdf.scripting.js/pdf.sandbox.js files from accidentally including most of the main-thread code (PR 12631 follow-up)
#12695 Various clean-up and improvements related to pdf.sandbox.js building, and the related default-viewer functionality
#12696 Fix non-standard quadpoints orders for annotations
#12634 JS -- Add aform functions
#12703 Ensure that the pdf.sandbox.js is removed from the DOM on destroy, and unbreak the Chromium-extension (PR 12695 follow-up)
#12707 Checkboxes with the same name must behave like a radio buttons group
#12712 Attempt to handle collapsed outline items, in the default viewer, according to the specification (issue 12704, PR 10890 follow-up)
#12722 JS -- fix printd issue with negative number
#12720 Be sure that CalculationOrder is either null or a non-empty array
#12668 Add some integration tests using puppeteer
#12723 Bump ini from 1.3.5 to 1.3.7
#12719 JS -- add function eMailValidate used to validate an email address
#12717 Ensure that the /Annots-entry, on /Page-instances, is actually an Array (issue 12714)
#12728 [gulpfile.js] Move the time-zone hack to the testing-pre task, such that all tests work regardless of the current time-zone
#12718 Ignore color-operators in Type3 glyphs beginning with a d1 operator (issue 12705)
#12725 Use widths defined by font for standard fonts.
#12732 Call done.fail correctly in the scripting_spec.js unit-tests
#12734 Update packages and translations
#12733 Add a test-case for bug 1292316
#12736 Remove the remaining IE 11 polyfills
#12700 Fix automatic zoom under spread mode
#12724 Follow-up of #12707: Add an integration test for checkboxes as radio …
#12737 Change the minimum "supported" version of the Safari-browser to Safari 10
#12635 JS -- Send events to the sandbox from annotation layer
#12742 Don't use 'in' operator to check if key is in a Map
#12689 In order to simplify m-c code, move some in pdf.js
#12741 JS -- Actions must be evaluated in global scope
#12754 Dispatch an event on sandbox creation
#12753 Ignore, rather than throwing on, Coding style component (COC) markers in JPEG 2000 images (issue 12752)
#12747 Add new "pageopen"/"pageclose" events for usage with JavaScript actions
#12702 JS - Collect and execute actions at doc level
#12748 Update the events, used with scripting, to use lower-case names and avoid using DOM events internally in the viewer + misc scripting-related tweaks
#12758 Run AnnotationStorage.resetModified when destroying the PDFDocumentLoadingTask/PDFDocumentProxy
#12760 Switch from Travis CI to GitHub Actions
#12761 Stop running gulp components as part of the unit-tests
#12751 Add a default DA for textfield to avoid issues when printing or saving
#12765 Avoid the getJavaScript API-call in PDFViewerApplication._initializeAutoPrint when "enableScripting" is set
#12770 Remove timeout in annotation integration test
#12637 JS -- Add support for buttons
#12771 [Scripting] Try to ensure that the WillPrint/DidPrint respectively DidSave events are always dispatched
#12773 Pass in the "sandboxBundleSrc" option when calling DefaultExternalServices.createScripting
#12780 Remove unused .noResults CSS-rule
#12781 Update packages and translations
#12766 Ignore, rather than throwing on, unsupported Coding style default (COD) options in JPEG 2000 images (issue 11004)
#12788 Include the state in the "presentationmodechanged" event, and remove the separate active/switchInProgress properties
#12792 Switch the badge in the README from Travis CI to GitHub Actions (PR 12760 follow-up)
#12793 Support the once option, when registering EventBus listeners
#12796 Extract common functionality into a new BaseTreeViewer._finishRendering method
#12800 Convert DefaultExternalServices.fallback to an asynchronous method
#12801 Modernize the FirefoxCom.request method
#12802 Add a new FirefoxCom.requestAsync method, to simplify the code in web/firefoxcom.js
#12805 Remove unnecessary toolbarButton icon-flipping in RTL mode (PR 11077 follow-up)
#12804 Remove the DownloadManager.onerror functionality, since its only usage is unlikely to be helpful
#12807 Remove unnecessary dir-dependent CSS rules, and add a missing CSS variable (PR 11077 follow-up)
#12774 JS -- Add tests for print/save actions
#12808 Disable a test using pending function
#12825 An option is missing for last versions of worker-loader to use pdf.js with webpack
#12815 Update webpack example
#12816 JS -- Plug PageOpen and PageClose actions
#12292 Fix encoding issues when printing/saving a form with non-ascii characters
#12822 Improve the PDFViewerApplication._contentLength handling in the viewer, related mostly to scripting
#12824 Improve the handling of errors, in PartialEvaluator.loadFont, occuring in PartialEvaluator.preEvaluateFont (issue 12823)
#12820 Don't dispatch "pageclose" events if a "pageopen" wasn't dispatched for the page (PR 12747 follow-up)
#12834 Try to fix TypeScript definitions for the es5-build in pdfjs-dist (issue 12872)
#12837 Remove unncessary CanvasFactory/CMapReaderFactory/FileReaderFactory duplication in unit-tests
#12394 In a text widget, Font resources can be in the appearance
#12777 Add support for finding/highlighting the outlineItem, corresponding to the currently visible page, in the sidebar (issue 7557, bug 1253820, bug 1499050)
#12843 Fix broken "issue12394" test-case
#12840 Use ESLint to ensure that exports are sorted alphabetically
#12842 Improve handling of JPEG images without an EOI marker (issue 12841)
#12844 Update packages and translations
#12845 Remove unnecessary dir-dependent CSS rules, and simplify som findbar-button rules (PR 11077 follow-up)
#12846 Enable the Stylelint length-zero-no-unit rule
#12848 Correctly align annotation content in horizontal/spead scrolling modes
#12838 [api-minor] Change the "dc:creator" Metadata field to an Array
#12853 Fix the initialization/resetting of scripting-related events in the BaseViewer
#12855 [api-minor] Highlight search results correctly for normalized text (PR 9448)
#12861 Always re-measure non-embedded ArialNarrow fonts (bug 1671312, PR 12725 follow-up)
#12812 Enforce line width to be at least 1px after applied transform
#12863 Remove a duplicated reference test (PR 12812 follow-up)
#12864 Enforce linewidth to 1px when at least one of scale factor is lower than 1
#12874 Put less emphasis on "ES5"/"ES6" in the README and other documentation
#12875 Replace some ternary operators with optional chaining, and nullish coalescing, in the src/display/-folder
#12871 Only display a notification on the sidebarToggle-button, and not the individual view-buttons (PR 7959 follow-up)
#12850 JS -- Add few missing constants in global scope
#12878 Remove redundant compatibility checks, for modern generic builds, in src/core/worker.js
#12869 Fix zoom issue with too thin lines
#12831 Add a parser to get font data from the default appearance
#12836 JS -- update radio/checkbox values even if there are no actions
#12888 Enable the Stylelint shorthand-property-no-redundant-values rule
#12890 Enable ESLint rules that no longer need to be disabled on a directory/file-basis
#12886 Use _defaultAppearanceData directly in WidgetAnnotation._getSaveFieldResources (PR 12831 follow-up)
#12887 Keep logical assignment operators in MOZCENTRAL/TESTING-builds
#12885 Simplify the PDFFunctionFactory._localFunctionCache initialization (PR 12034 follow-up); Fix the gStateObj lookup in TranslatedFont._removeType3ColorOperators (PR 12718 follow-up)
#12891 Ensure that parseDefaultAppearance won't attempt to access a not yet defined variable (PR 12831 follow-up)
#12828 [api-minor] Set font size and color for text widget annotations
#12893 Enable, a basic version of, the ESLint no-use-before-define rule
#12870 Add previous/next-page functionality that takes scroll/spread-modes into account (issue 11946)
#12899 Update the ESLint env to use "es2021"
#12898 Update packages and translations
#12897 JS - Fix mouse event names

Don't miss a new pdfjs-dist release

NewReleases is sending notifications on new releases.