react-pdf

Display PDFs in your React app as easily as if they were images.

MIT License

Downloads
4.3M
Stars
8.6K
Committers
57

Bot releases are hidden (Show)

react-pdf - v7.0.0-beta.4

Published by wojtekmaj over 1 year ago

Bug fixes

  • Fixed propTypes that could have crashed SSR.
react-pdf - v7.0.0-beta.3

Published by wojtekmaj over 1 year ago

Bug fixes

  • Fixed black flicker when rendering canvas (#1340, #1279). Thanks, @MattL75!
react-pdf - v7.0.0-beta.2

Published by wojtekmaj over 1 year ago

Bug fixes

  • Fixed "The --scale-factor CSS-variable must be set" error.
react-pdf - v7.0.0-beta

Published by wojtekmaj over 1 year ago

This is one of the biggest update - for React-PDF and for me personally. React-PDF has been rewritten from scratch using TypeScript and React Hooks. I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped through 137 unit tests we have, please let me know. I hope you will like it.

❗️ = breaking change

What's new?

  • Converted package to TypeScript (#1420).
  • Rewritten package using React Hooks (#1370).
  • Updated PDF.js to 3.6.172.
    • Preparations for editor mode support
    • Removed support for outdated browser versions
    • Font conversion/text selection improvements
    • Annotation improvements
    • Image rendering improvements that allow rendering big images even if they are larger than the canvas limits
    • Accessibility improvements
    • Improved overall performance
    • Reduced memory usage
    • Other features/bugfixes

What's changed?

  • React-PDF is now considerably smaller.
  • ❗️ Bundler-specific entry points are no longer provided. Don't worry though, the setup should be straightforward.
  • ❗️ Dropped support for older browsers.
  • ❗️ Removed legacy renderInteractiveForms prop
react-pdf -

Published by wojtekmaj almost 2 years ago

Bug fixes

  • Fixed rendering glitches on certain browsers & graphic cards (#1010).
react-pdf -

Published by wojtekmaj almost 2 years ago

What's changed?

  • Brought back pageIndex and pageNumber in customTextRenderer args that, despite undocumented, may have been used by some (#1190).
  • Replace typeof window checks with typeof document checks to avoid Deno environment being falsely recognized as browser environment.

Bug fixes

  • Fixed onItemClick callback working only once per item (#997, #1192).
  • Fixed first annotation item not clickable (#1231).
  • Fixed typos in documentation (#1227). Thanks, @flaxflour!
react-pdf -

Published by wojtekmaj almost 2 years ago

What's new?

  • Added support for devicePixelRatio prop in Page component.

Bug fixes

  • Pass the actual itemIndex to the customTextRenderer (#1183). Thanks, @paescuj!
react-pdf -

Published by wojtekmaj almost 2 years ago

Bug fixes

  • Fixed text items misaligned when using customTextRenderer and if textContent items have both text and line break (#1173).
react-pdf -

Published by wojtekmaj almost 2 years ago

What's new?

  • Improved text selection behavior (#1034).
react-pdf -

Published by wojtekmaj almost 2 years ago

Bug fixes

  • Fixed customTextRenderer called too often and potentially with undefined str (#1151).
  • Fixed text layer rendering twice when using React 18 w. StrictMode on.
react-pdf -

Published by wojtekmaj almost 2 years ago

Bug fixes

  • Fixed Vite specific entry causing fake worker to be initialized (#1148).
react-pdf -

Published by wojtekmaj almost 2 years ago

Bug fixes

  • Fixed Vite specific entry causing build to fail (#1148).
react-pdf - v6.0.0

Published by wojtekmaj almost 2 years ago

See Upgrade guide from version 5.x to 6.x.

Note: React <16.8 is not supported. If you're still using React older than 16.8, please use react-pdf@^5.0.0 instead.

❗️ = breaking change

What's new?

  • ❗️ Vastly improved performance and bundle size thanks to the modern version of PDF.js that is now used. This drops support for legacy browsers. See README for details.
  • Added official support for Vite.
  • Updated PDF.js to 2.16.105 (#1019).
    • Improvements for the text layer (space insertion)
    • Improvements for canvas rendering (thin line rendering)
    • Improvements for forms (printing/saving of choice lists)
    • Improvements for accessibility (sidebar and search results)
    • Bug fixes and optimizations, in particular for annotations, font/image conversion, SMask rendering, text layer rendering and TypeScript definitions
    • Performance improvements for rendering image masks, Type3 fonts and certain drawing instructions
    • Support for specifying custom background/foreground colors for rendering in the viewer (this will be soon be supported in React-PDF)
    • Bugfixes
    • Accessibility improvements
    • Rendering quality improvements.
  • Improved documentation.
    • Fixed instructions on PDF.js worker
    • Added missing documentation on onRenderTextLayerError and onRenderTextLayerSuccess
    • Added a note on SVG mode deprecation.
  • Refactored TextLayer to use pdfjs.renderTextLayer (#944).
    • Added support for onRenderTextLayerError prop
    • Added support for onRenderTextLayerSuccess prop.
  • React-PDF now warns if required CSS files are not imported.

What's changed?

  • ❗️ Minimum React version is now 16.8.
  • ❗️ onGetTextSuccess is now called with an object containing items and styles.
  • ❗️ TextLayer.css now must be imported manually for TextLayer to work properly.
  • ❗️ Dropped support for React content in customTextRenderer (#1124).
  • file-loader is now an optional peerDependency (#970). Thanks, @rpaasche!
  • Improved documentation on Preact compatibility.
  • Replaced merge-class-names with clsx.

Bug fixes

  • Fixed crash when attempting to cancel rendering of PageCanvas.
  • Fixed crash when text layer in PDFs rendered by React-PDF was used in Preact applications.
  • Fixed legacy renderInteractiveForms prop ignored. Thanks, @liquidautumn!
  • Fixed Page wrapper allowing to shrink causing children to overflow (#1118).
react-pdf -

Published by wojtekmaj almost 2 years ago

What's changed?

  • Replaced merge-class-names with clsx.
  • Reverted "Removed dependency on @babel/runtime.".
react-pdf -

Published by wojtekmaj almost 2 years ago

❗️ = breaking change

What's new?

  • Added official support for Vite.
  • Removed dependency on @babel/runtime.

What's changed?

  • ❗️ Dropped support for React content in customTextRenderer (#1124).

Bug fixes

  • Fixed Page wrapper allowing to shrink causing children to overflow (#1118).
react-pdf -

Published by wojtekmaj about 2 years ago

What's new?

  • Updated PDF.js to 2.16.105.
    • Bugfixes
    • Accessibility improvements
    • Rendering quality improvements.
  • Improved documentation.
    • Fixed instructions on PDF.js worker
    • Added missing documentation on onRenderTextLayerError and onRenderTextLayerSuccess
    • Added a note on SVG mode deprecation.
  • React-PDF now warns if required CSS files are not imported.

What's changed?

  • Removed support for enhanceTextSelection prop. This was previously implemented in 6.0.0-beta, but later found deprecated in PDF.js.

Bug fixes

  • Fixed legacy renderInteractiveForms prop ignored. Thanks, @liquidautumn!
react-pdf - v6.0.0-beta.3

Published by wojtekmaj about 2 years ago

What's changed?

  • file-loader is now an optional peerDependency (#970). Thanks, @rpaasche!
react-pdf -

Published by wojtekmaj over 2 years ago

What's changed?

  • Improved documentation on Preact compatibility.

Bug fixes

  • Fixed crash when text layer in PDFs rendered by React-PDF was used in Preact applications.
react-pdf -

Published by wojtekmaj over 2 years ago

See Upgrade guide from version 5.x to 6.x.

Note: React <16.8 is not supported. If you're still using React older than 16.8, please use react-pdf@^5.0.0 instead.

❗️ = breaking change

What's new?

  • ❗️ Vastly improved performance and bundle size thanks to the modern version of PDF.js that is now used. This drops support for legacy browsers. See README for details.
  • Updated PDF.js to 2.14.305 (#1019).
    • Improvements for the text layer (space insertion)
    • Improvements for canvas rendering (thin line rendering)
    • Improvements for forms (printing/saving of choice lists)
    • Improvements for accessibility (sidebar and search results).
    • Bug fixes and optimizations, in particular for annotations, font/image conversion, SMask rendering, text layer rendering and TypeScript definitions.
    • Performance improvements for rendering image masks, Type3 fonts and certain drawing instructions
    • Support for specifying custom background/foreground colors for rendering in the viewer (this will be soon be supported in React-PDF).
  • Refactored TextLayer to use pdfjs.renderTextLayer (#944).
    • Added support for enhanceTextSelection prop.
    • Added support for onRenderTextLayerError prop.
    • Added support for onRenderTextLayerSuccess prop.

What's changed?

  • ❗️ Minimum React version is now 16.8.
  • ❗️ onGetTextSuccess is now called with an object containing items and styles.
  • ❗️ TextLayer.css now must be imported manually for TextLayer to work properly.

Bug fixes

  • Fixed crash when attempting to cancel rendering of PageCanvas.
react-pdf - v5.7.2

Published by wojtekmaj over 2 years ago

What's new?

  • Added instructions on support for standard fonts.
  • Make findDocumentSource cancellable, cancel running tasks in loadDocument before finding source (#947).

Bug fixes

  • Fixed Page not rendering in canvas rendering mode (default) when using React 18 w. StrictMode on (#972).
Package Rankings
Top 0.62% on Npmjs.org
Top 3.71% on Proxy.golang.org
Badges
Extracted from project README
npm CI
Related Projects