Bundled PDF.js: 6.4.299 (unchanged).
Fixed
- Safari and iOS older than 18.4 couldn't start the viewer
(#457). PDF.js 6.4.299 touches
theIteratorglobal as soon as it loads, so on those versions the page stayed on
"Loading PDF...". The polyfills injected into the bundled PDF.js now add the iterator
helpers,AbortSignal.any()and async iteration ofReadableStream, which covers Safari
and iOS 17 and 18.0 to 18.3. - On Safari and iOS 17.0 to 17.3, pages kept their loading spinner and never drew. The PDF.js
worker packs every font withArrayBuffer.prototype.transferToFixedLength()(Safari 17.4),
so no font reached the page; it's polyfilled now. - On Safari and iOS older than 17.5 the toolbar icons were invisible and fields and menus lost
their colours, because PDF.js sets them with CSSlight-dark(). The build now appends plain
fallback values for PDF.js's top-level colour variables, used only by browsers without
light-dark()and following the component'stheme. Some sidebar and dialog colours there
still fall back to browser defaults. - On Safari and iOS 17.0 and 17.1, pages were drawn about three times too large and cut off, and
zooming or scrolling never showed the rest. PDF.js writes its stylesheet with CSS nesting, and
those versions drop a nested rule that starts with an element name (Safari 17.2 relaxed that),
including the one that fits each page's canvas to its box. The build now flattens the nesting
inviewer.css, which also adds-webkit-backdrop-filterfor Safari before 18. - A numeric
zoomset before the document's first view came out 100 times too small:"1.4"
showed the page at 1.4% instead of 140%. PDF.js reads its initial zoom as a percentage, while
zoomandzoomChangeuse scale factors, so an app that savedzoomChangeand set it again
on the next document lost the page. The value is now converted on that path. Thanks to
@jhthompson for the fix. (#459) - When PDF.js can't start at all, the loading spinner no longer runs forever. That happens on
Safari and iOS 16 or older (no build of PDF.js 6.x supports them, Mozilla's legacy build
included) or when a viewer file fails to load. The component now stops loading and fires
onDocumentErrorwithname: 'UnsupportedBrowser'orname: 'ViewerLoadError', so the
app decides what its users see.
Added
customErrorTpltemplates receiveerrorNamealongsideerrorMessageanderrorClass, so
a template can show its own message for an unsupported browser.
Docs
Error-Display-Examples.mddescribed built-in error templates (errorTemplate="basic"and
others) that were deprecated in 25.0.0 and are no longer in the package, and its custom
template example read a context variable that doesn't exist. It now documents
customErrorTplas it works. Several docs-site examples left out[errorOverride]="true",
without whichcustomErrorTplnever shows.