github mozilla/pdf.js v2.8.335

latest releases: v4.4.168, v4.3.136, v4.2.67...
3 years ago

This release features initial support for XFA (in addition to the support for AcroForms). Moreover, it contains lots of improvements related to scripting, text layer positioning, annotations, printing, accessibility and performance.

Changes since v2.7.570:

#12901 Bump versions in pdfjs.config
#12826 JS -- add support for choice widget
#12914 JS - QuickJS sandbox initialization must be the last evaluated string
#12916 Include pdf.sandbox.js when building the pdfjs-dist files
#12911 Fix text layer regression tests in using the correct line-height property
#12910 Add back dir property in spans in text layer
#12903 Improve global image caching for small images (PR 11912 follow-up, issue 12098)
#12924 Fix font data clone error when pdfBug is enabled.
#12922 Ignore globally cached images in PartialEvaluator.getTextContent (PR 11930 follow-up)
#12920 fix(acroforms): pdf path in acroforms example
#12931 Stop showing the fallback bar for "errorFontLoadNative" errors (PR 10539 follow-up)
#12932 Stop including -ms prefixed CSS rules in GENERIC builds
#12933 Stop polyfilling CSS variables in GENERIC builds
#12935 Remove prefixed fullscreen properties/methods from the MOZCENTRAL builds
#12879 XFA - Add a parser for XFA files
#12943 Re-enable the issue6961 test-case (issue 7112)
#12947 Update Puppeteer to version 6 (issue 12945)
#12954 XFA -- Add attributes and children in XFAObject
#12952 Don't focus the PasswordPrompt input-field on load, when the viewer is embedded in e.g. an iframe (issue 12951)
#12956 Update Puppeteer to version 7
#12946 XFA -- Add template object
#12944 XFA -- Update config object
#12941 fix(a11y): resolve sidebar, find, toolbar missing aria-expanded and aria-controls state
#12961 Use optional chaining, where possible, in the web/-folder
#12965 Request all data, rather than throwing, when encountering general errors in ObjectLoader._walk (issue 9462, PR 3289 follow-up)
#12966 Update packages and translations
#12962 Handle errors gracefully, in PartialEvaluator.translateFont, when fetching the font file (issue 9462)
#12970 Split PDFViewerApplication.error into two methods, for PDF document loading/parsing errors vs other errors (PR 11647 follow-up)
#12971 Use DOM hidden property instead of attribute methods
#12975 Remove the contentmenu usage, from PresentationMode, since it's no longer working
#12972 [GENERIC viewer] Skip the iframe-case when checking if the container div, on BaseViewer-instances, is absolutely positioned (PR 12354 follow-up)
#12973 Use Math.hypot, instead of Math.sqrt with manual squaring
#12978 [api-minor] Rename -es5 to -legacy, to reduce confusion over what's actually supported (issue 12976)
#12948 XFA -- Add localset object
#12949 XFA -- Add other objects
#12982 Update the year in the license_header files
#12984 Replace a few new Date().getTime() instances with Date.now()
#12981 Collect the l10n error/warning message lookup, in web/app.js, in a new helper method
#12904 fix initial state of checkboxes in display layer
#12987 Restore window.alert after use in scripting test
#12986 Remove the unused "loading_error_indicator" l10n string (PR 2719 follow-up)
#12988 Remove unneeded instanceof MissingDataException checks
#12896 Modifiy the way to compute baseline to have a better match between canvas and text layer
#12992 Use a more compact format for the fallback EventBus-listeners in PDFViewerApplication_initializeJavaScript
#12991 Stop including unused/unnecessary code in the viewer, for MOZCENTRAL-builds
#12993 [api-minor] Change the dc:subject Metadata field to an Array
#12964 Avoid infinite loop when getting annotation field name
#12995 Stop showing the fallback bar for "errorFontMissing" errors (PR 11218 follow-up)
#12830 JS -- Fix doc.getField and add missing field methods
#12936 XFA - Add a lexer/parser for FormCalc language
#12998 Simplify the default value handling of renderInteractiveForms in the viewer components
#12999 [api-minor] Remove support for synchronous event dispatching in LoopbackPort
#12997 Move the Metadata parsing to the worker-thread
#12979 XFA - Add support for prototypes
#13001 Send the AnnotationStorage-data to the worker-thread as a Map
#13004 Add a this-bound method for InternalRenderTask.cancel
#13007 Update packages and translations
#13005 JS - Fix setting a color on an annotation
#13008 Allow minor and patch versions for the webpack-stream dependency again
#12983 XFA -- Add support for SOM expressions
#13011 Remove extra new line from HTML source.
#13009 Move the opening of PDF file attachments into the DownloadManager-implementations
#13019 Remove the findResultsCount-check from PDFFindBar.updateResultsCount, and unnecessary defaults from the constructor
#13020 Remove the NullL10n default value from viewer components not included in the COMPONENTS-bundle
#13021 Remove the, strictly unnecessary, closure and variable shadowing from createObjectURL
#13014 [api-minor] Support the Content-Disposition filename in the Firefox PDF Viewer (bug 1694556, PR 9379 follow-up)
#13025 Convert code in src/core/function.js to use "normal" classes
#13026 Convert code in src/core/crypto.js to use "normal" classes
#13024 Update Puppeteer to version 8
#13023 Fix integration test with js-colors
#13029 Enable the no-var linting rule in more core files
#13030 Modernize some of the code in src/core/cmap.js by using classes and async/await
#13031 Implement rendering square/circle annotations without appearance stream
#13032 Don't warn about actions that require scripting support in Catalog.parseDestDictionary
#13033 Implement rendering line annotations without appearance stream
#13039 Change the background to ensure that the sidebar is visible/readable when the viewer is narrow (issue 13036)
#13045 Bump pug-code-gen from 2.0.1 to 2.0.3
#13050 Collect all l10n fallback strings, used in the viewer, in one helper function (PR 12981 follow-up)
#13053 Enable scripting by default in the development viewer; remove the standalone acroforms example
#13042 [api-minor] Move the viewer scripting initialization/handling into a new PDFScriptingManager class
#13054 Move handling of the PageOpen/PageClose events into the PDFScriptingManager (PR 13042 follow-up)
#13060 Update packages and translations
#13055 JS - reset correctly radio buttons
#13062 Remove the test/features folder, since it's very out of date (issue 11954)
#13063 Use more optional chaining in the web/-folder (PR 12961 follow-up)
#13018 XFA - Create Form DOM in merging template and data trees
#13015 JS - Avoid a popup to ask for updating Acrobat.
#13078 Disable intermittent unit test "creates pdf doc from non-existent URL"
#13074 Re-factor the PDFScriptingManager._destroyScripting method (PR 13042 follow-up)
#13081 Replace the objectFromEntries helper function with an objectFromMap one instead, and simplify the data lookup in the AnnotationStorage.getValue method
#13085 Ensure that all errors are handled in rasterizeTextLayer/rasterizeAnnotationLayer
#13090 Enable the ESLint no-var rule in gulpfile.js
#13079 Ensure that getDocument handles Node.js Buffers more gracefully (issue 13075)
#13087 Enable the ESLint no-var rule in the examples/ folder
#13084 Enable the ESLint no-var rule in a few font-parsing files, and convert src/core/type1_parser.js to use "standard" classes
#13092 Enable the ESLint no-var rule in the importL10n/ folder
#13091 Enable the ESLint no-var rule globally
#13093 Enable the ESLint no-var rule in the external/builder/ folder
#13097 Enable the ESLint no-var rule in test/add_test.js
#13096 Enable the ESLint no-var rule in the test/stats/ folder
#13095 Enable linting of the external/cmapscompress/ folder
#13098 Enable the ESLint no-var rule in the external/ folder
#13094 Enable the no-var linting rule for src/core/{operator_list, pattern}.js
#13101 print: Remove invalid @supports condition.
#13100 print: Ensure print containers have the right size and don't create overflow.
#13102 print: RFC: Center when printing a PDF with smaller size than the output page.
#13104 Ensure that printing, triggered from scripting, won't accidentally throw in PDFScriptingManager._updateFromSandbox
#13106 Support LineAnnotations with empty /Rect-entries (issue 6564)
#13069 [api-minor]XFA - Add a layer to display XFA forms
#13119 Actually reset the PDFPageProxy._xfaPromise property as intended (PR 13069 follow-up)
#13120 Rotate landscape pages, during printing, by default in the viewer (enablePrintAutoRotate = true)
#13116 Enable scripting by default in the viewer (PR 13053 follow-up)
#13113 Ignore some scripting events which don't make sense in PresentationMode
#13105 Improve memory usage around the BasePdfManager.docBaseUrl parameter (PR 7689 follow-up)
#13118 Add landmark region and aria-label for each page.
#13124 Tweak the pre-processor condition, for Node.js environments, in the animationStarted helper (issue 13057)
#13117 Re-factor the default preferences generation to support build targets (PR 10548)
#13126 Update packages and translations
#13125 Don't provide the enableXfa parameter to the BaseViewer constructor, and avoid the fallback bar with enableXfa = true set (PR 13069 follow-up)
#13135 Fix typo in pdf_history.js
#13128 Re-factor how the BasePreferences.prefs-property is initialized; remove some indirect loops
#13082 XFA - Convert some template properties into CSS ones
#13149 Set CFF header to 4 when writing it because it contains 4 elements
#13140 [GrabToPan] Remove more IE-specific code, and remove unconditional browser sniffing
#13145 print: Improve rendering of oversized pages.
#13144 [GrabToPan] Use Element.matches() rather than prefixed ...matchesSelector versions
#13138 [PDFHistory] Correctly simulate an internal destination in the pushPage-method (PR 12493 follow-up)
#13056 Dispatch a "Doc/WillClose" event, when scripting is enabled, when closing the document
#13154 Update quickjs to revision b5e62895c619d4ffc75c9d822c8d85f1ece77e5b
#13155 Move rotation normalization from PDFViewerApplication and into BaseViewer
#13152 Skip extra objects in object stream in using offsets
#13160 Improve handling of linked test-cases for the unit/integration suites
#13133 JS - Handle correctly hierarchy of fields
#13115 XFA - Add support for few ui elements
#13161 Bump y18n from 3.2.1 to 3.2.2
#13156 Prevent errors, in PDFOutlineViewer._getPageNumberToDestHash, for invalid destRef values (PR 12777 follow-up)
#13158 Remove the URL polyfill
#13157 Remove the file://-URL special-case from webViewerOpenFileViaURL
#13166 [api-minor] Support proper URL-objects, in addition to URL-strings, in getDocument
#13165 [api-minor] Stop exposing the raw defaultAppearance-string on Annotation-instances
#13168 Use post table when Encoding has only Differences
#12908 Slightly rescale lineWidth to workaround chrome rendering issue
#13169 [api-minor] Change the format of the fontName-property, in defaultAppearanceData, on Annotation-instances (PR 12831 follow-up)
#13177 Update packages and translations
#13175 [GENERIC viewer] Avoid data loss in forms, by triggering saving when the document is closed (issue 12257)
#13179 Utilize Set a bit more in the code-base
#13172 [api-minor] Add an option, in PDFDocumentProxy.cleanup, to allow fonts to remain attached to the DOM

Don't miss a new pdf.js release

NewReleases is sending notifications on new releases.