rp
4.0/56

react-pdf

npm i react-pdf

113 Versions

6.2.0

latest
10 days ago
What's new?
  • Added support for devicePixelRatio prop in Page component.
Bug fixes
  • Pass the actual itemIndex to the customTextRenderer (#1183). Thanks, @paescuj!

6.1.1

11 days ago
Bug fixes
  • Fixed text items misaligned when using customTextRenderer and if textContent items have both text and line break (#1173).

6.1.0

16 days ago
What's new?
  • Improved text selection behavior (#1034).

6.0.3

22 days 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.

6.0.2

23 days ago
Bug fixes
  • Fixed Vite specific entry causing fake worker to be initialized (#1148).

6.0.1

24 days ago
Bug fixes
  • Fixed Vite specific entry causing build to fail (#1148).

6.0.0

24 days 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).

6.0.0-beta.6

next
24 days ago
What's changed?
  • Replaced merge-class-names with clsx.
  • Reverted "Removed dependency on @babel/runtime.".

6.0.0-beta.5

1 month 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).

6.0.0-beta.4

2 months 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!

6.0.0-beta.3

4 months ago
What's changed?
  • file-loader is now an optional peerDependency (#970). Thanks, @rpaasche!

6.0.0-beta.2

5 months 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.

6.0.0-beta

5 months 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.

5.7.2

8 months 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).

5.7.1

10 months ago
What's changed?
  • Replaced deprecated renderInteractiveForms option with annotationMode in page.render call (#946).
Bug fixes
  • Use workerPort instead of workerSrc in Parcel 2 specific entry (#941). Thanks, @jamesjessian!
  • Fixed regression that caused interactive forms to be always rendered.

5.7.0

10 months ago

Biggest one in months!

What's new?
  • Added support for React 18.
  • Added official support for Parcel 2.
  • Added new Webpack 5-specific entry file. It uses Webpack's new URL assets instead of worker-loader, which turned out to be quite problematic in the past. Don't worry, if you want to stick to the old Webpack-specific one, it should still work just fine!
  • Updated PDF.js to 2.12.313 (#936).
    • Improved XFA support
    • Improved pattern/tiling support
    • Rich text annotation support
  • Added support for externalLinkRel prop.
  • Added dest and pageIndex to onItemClick callbacks (#812, #924). Thanks, @malwilley!
What's changed?
  • Updated cMaps instructions to work with Yarn PnP.
  • Updated PDF.js worker instructions for clarity.
    • Specify how to make it work with Create React App 5.
  • Added instructions on how to manually copy cMaps directory.
  • Added instructions on how to manually copy pdf.worker.js.
  • Added Create React App 5 sample suite.
  • Added Parcel 2 sample suite.

5.6.0

1 year ago
What's new?
  • Updated PDF.js to 2.10.377 (#900).
    • Improved XFA support (#856).

5.5.0

1 year ago
What's new?
  • Added canvasBackground prop (#851). Thanks, @paescuj!

5.4.1

1 year ago
Bug fixes
  • Fixed LinkService crashing given already-resolved dest (#869).

5.4.0

1 year ago
What's new?
  • Updated PDF.js to 2.9.359 (#818).
    • Added support for Signatures (#559, #691, #772, #817).
    • Fixed rendering on Chrome 92 and up (#819).
  • Replaced pdfjs-dist build with legacy ES5 version (#794). Thanks, @njleonzhang!
  • Changed async/await syntax to Promises, reducing build size significantly (#807).
Bug fixes
  • Fixed annotation links no longer working in some cases (#816).

5.4.0-beta.3

1 year ago
What's changed?
  • Replaced pdfjs-dist build with legacy ES5 version (#794). Thanks, @njleonzhang!

5.4.0-beta.2

1 year ago
What's new?
  • Updated PDF.js to 2.9.359 (#818).
    • Added support for Signatures (#559, #691, #772, #817).
    • Fixed rendering on Chrome 92 and up (#819).
Bug fixes
  • Fixed annotation links no longer working in some cases (#816).

5.3.2

1 year ago
Bug fixes
  • Fixed file prop type checker not accepting data as string (#800).

5.4.0-beta

1 year ago
What's new?
  • Changed async/await syntax to Promises, reducing build size significantly (#807).

5.3.1

1 year ago
What's changed?
  • Made documentation on bundler-specific entry files clearer.
  • Minor code optimizations for smaller bundle size.
Bug fixes
  • Fixed onLoadProgress incorrectly listed as Page prop in README.
  • Fixed data URI not parsed properly when having multiple headers (#784).

5.3.0

2 years ago
What's new?
  • Updated PDF.js from 2.5.207 to 2.6.347 (#746). Thanks, @andi-dev!
  • Replaced worker-loader with file-loader in Webpack-specific entry file (#93, #291, #496, #530, #558, #613, #685, #734, #756). Webpack-specific entry file now works with Create React App.
  • Improved memory management by destroying previous worker when file changes (#288, #305, #755). Thanks, @jeetiss!
What's changed?
  • Replaced PDFLinkService with custom LinkService (#657, #659, #749).
  • Use public API for rendering cancellation (#757). Thanks, @jeetiss!
Bug fixes
  • Fixed file prop checked using function with the same name.

5.3.0-beta.3

2 years ago
What's new?
  • Improved memory management by destroying previous worker when file changes (#288, #305, #755). Thanks, @jeetiss!
What's changed?
  • Use public API for rendering cancellation (#757). Thanks, @jeetiss!

5.3.0-beta.2

2 years ago
What's new?
  • Replaced worker-loader with file-loader in Webpack-specific entry file (#93, #291, #496, #530, #558, #613, #685, #734, #756). Webpack-specific entry file now works with Create React App.
Bug fixes
  • Fixed file prop checked using function with the same name.

5.3.0-beta

2 years ago
What's new?
  • Updated PDF.js from 2.5.207 to 2.6.347 (#746). Thanks, @andi-dev!
What's changed?
  • Replaced PDFLinkService with custom LinkService (#657, #659, #749).

5.2.0

2 years ago
What's new?
  • Allow overriding of imageResourcesPath (#728). Thanks, @hchevalier!

5.1.0

2 years ago
What's new?
  • Added React 17 compatibility.
  • Updated PDF.js to 2.5.207 (#686, #687).

5.1.0-beta

2 years ago
What's new?
  • Added React 17 compatibility
  • Updated PDF.js to from 2.4.456 to 2.5.207 (#686, #687).

5.0.0

2 years ago

❗️ = breaking change

What's new?
  • ❗️ React-PDF now ships with ES6 Modules along with CommonJS modules. This allows for Webpack and other bundlers to optimize your code better.
  • Updated PDF.js from 2.1.266 to 2.4.456. Thanks, @kylemellander!
What's changed?
  • ❗️ Internet Explorer 11 is no longer supported.
  • ❗️ Removed renderAnnotations backwards compatibility (#431).
  • ES6 builds of PDF.js are now used since Internet Explorer 11 support was dropped anyway.
  • Changed the way PDFDataRangeTransport is imported.
  • Explicitly initialize an EventBus instance (#593). Thanks, @danieltott!
Bug fixes
  • Fixed memory leak after unmounting Document (#452, #505). Thanks, @oze4!
  • Fixed error, loading, noData propTypes not accepting functions (#579).
  • Fixed PDF rendering incorrectly if wrapped in an element with dir="rtl" (#588).
  • Added null check before calling destroy() method on loadingTask.

5.0.0-beta.5

2 years ago
What's changed?
  • ES6 builds of PDF.js are now used since Internet Explorer 11 support was dropped anyway.
  • Changed the way PDFDataRangeTransport is imported.
  • Explicitly initialize an EventBus instance (#593). Thanks, @danieltott!

4.2.0

2 years ago
What's new?
  • Greatly improved documentation. Thanks, everyone!
What's changed?
  • Development platform upgrade - now v4.x branch uses the same build tools as v5.x branch.
Bug fixes
  • Fixed memory leak after unmounting Document (#452, #505). Thanks, @oze4!
  • Fixed error, loading, noData propTypes not accepting functions (#579).
  • Fixed PDF rendering incorrectly if wrapped in an element with dir="rtl" (#588).

5.0.0-beta.4

2 years ago

❗️ = breaking change

What's new?
  • Updated PDF.js from 2.3.200 to 2.4.456. Thanks, @kylemellander!
What's changed?
  • ❗️ Internet Explorer 11 is no longer supported.
Bug fixes
  • Added null check before calling destroy() method on loadingTask.

5.0.0-beta.3

3 years ago
What's new?
  • Updated PDF.js from 2.2.228 to 2.3.200.
Bug fixes
  • Fixed memory leak after unmounting Document (#452, #505). Thanks, @oze4!

5.0.0-beta.2

3 years ago

❗️ = breaking change

What's changed?
  • ❗️ Removed renderAnnotations backwards compatibility (#431).
Bug fixes
  • Fixed PDF.js falling back to fake worker with sideEffects: false (#502). Thanks, @robsco-git!

5.0.0-beta

3 years ago

❗️ = breaking change

What's new?
  • ❗️ React-PDF now ships with ES6 Modules along with CommonJS modules. This allows for Webpack and other bundlers to optimize your code better.
  • Updated PDF.js from 2.1.266 to 2.2.228.
Bug fixes
  • Fixed memory leak after unmounting Document (#452, #505). Thanks, @oze4!
  • Fixed error, loading, noData propTypes not accepting functions (#579).
  • Fixed PDF rendering incorrectly if wrapped in an element with dir="rtl" (#588).

4.2.0-beta

3 years ago

❗️ = breaking change

What's new?
  • ❗️ React-PDF now ships with ES6 Modules along with CommonJS modules. This allows for Webpack and other bundlers to optimize your code better.

4.1.0

3 years ago
What's new?
  • You can now use ref on Page and Outline components.
  • You can now pass render functions to error, loading, noData props (#390).
  • React-PDF will now cancel loading a document if a new document was provided (#357).
What's changed?
  • Improved documentation for Create-React-App users (#369). Thanks, @suyesh!
Bug fixes
  • Fixed font family in TextLayer not properly recognized in some cases (#385).
  • Fixed onParseError, onParseSuccess still documented despite being removed (#400).

4.0.5

4 years ago
Bug fixes
  • Fix onPassword and onLoadProgress props not working (#364).
  • Fixed text layer vertically misaligned in some cases (#332).

4.0.4

4 years ago
What's changed?
  • TextLayer items are now rendered using span elements, making it easier to select the text.
  • Improved memory consumption on many browsers, including Firefox and iOS Safari (#335). Thanks, @robsco-git!
Bug fixes
  • Fixed "Deprecated API usage: RenderTask.then method, use the promise getter instead" (#354).

4.0.3

4 years ago
What's new?
  • Updated PDF.js to 2.1.266
Bug fixes
  • Fixed "Error: Can't resolve 'babel-runtime/regenerator'" error (#310).
  • Fixed documentation for onPassword (#333). Thanks, @hdwatts!

4.0.2

4 years ago
What's changed?
  • Using Parcel, if you decide for whatever reason to import from src directory instead of default dist, Parcel will properly recognize it and use proper Babel configuration.
Bug fixes
  • Fixed width/height props not working with scale prop correctly (#322).
  • Fixed an error that has caused setState warning on an unmounted component (#328) if you changed the page before the previous one has fully loaded.

4.0.0

4 years ago

See Upgrade guide from version 3.x to 4.x.

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

What's new?
  • React-PDF now uses new Context API giving it much improved reliability and stability.
  • React-PDF now uses PDF.js 2.0, bringing in a lot of fixes and improvements.
  • Webpack 4.x and Create-React-App 2 are now supported (#179).
  • React-PDF is now fully compatible with React 17 (sic!).
  • Interactive forms can now be rendered by toggling renderInteractiveForms flag.
  • You can now use height prop on Page component to scale the page. height will be ignored if you provide width as well. More details in README.md (#236).
  • You can now attach keyboard events to <Page /> component.
  • Added support for password encrypted PDFs. You can use onPassword prop to overwrite default password prompt (#241).
  • You can now pass onLoadProgress callback to Document component to be updated on document loading progress. This may come in handy if you load PDF to be displayed from a web server (#238)
  • You can now pass renderMode prop to all Page components by adding it to wrapping Document component instead.
  • Added externalLinkTarget prop which allows to configure target for external links rendered in annotations (#262).
  • Added renderMode none which does not render the main layer at all (#283).
What's changed?
  • You can no longer use React-PDF without Web Worker.
  • setOptions function has been replaced with much more powerful options prop in Document component.
  • TextLayer is now rendered over SVG to match Canvas rendering mode behavior.
  • Removed max-width from rendered SVG to match Canvas rendering mode behavior (#251).
  • renderAnnotations was renamed to renderAnnotationLayer for consistency. You don't need to change anything in your code just yet.
  • Clarified documentation for onItemClick.
  • React-PDF now uses Babel 7 for compilation (#270).

3.0.6

4 years ago

This is most likely the last release from 3.x branch. It picks the bug fixes made during React-PDF 4.x development back to 3.x version for developers which chose to use older versions of React.

What's new?
  • Added documentation for renderMode.
Bug fixes
  • Fixed annotation rendering multiple times if an update which does not reset the layout occurs (#192).
  • Fixed TextLayerItem re-rendering too often (#213, #215). Thanks, @lsimkins!
  • Fixed a false positive PropTypes error when passed a React node as error or loading props (#293). Thanks, @pimmey!
  • Fixed page not displaying when passed null to scale prop.

4.0.0-beta.6

4 years ago
What's new?
  • Added renderMode none which does not render the main layer at all (#283).
What's changed?
  • renderAnnotations was renamed to renderAnnotationLayer for consistency. You don't need to change anything in your code just yet.
Bug fixes
  • Pinned down PDF.js version to 2.0.550 because of breaking changes in 2.0.943 (#298).

4.0.0-beta.5

4 years ago
What's new?
  • You can now attach keyboard events to <Page /> component.
What's changed?
  • React-PDF now uses Babel 7 for compilation (#270).

4.0.0-beta.4

4 years ago
What's new?
  • Added externalLinkTarget prop which allows to configure target for external links rendered in annotations (#262).
What's changed?
  • Sample and Test suites were updated for Webpack 4.

4.0.0-beta.3

4 years ago
What's new?
  • Added support for password encrypted PDFs. You can use onPassword prop to overwrite default password prompt (#241).
  • Added documentation for renderMode.
  • You can now pass onLoadProgress callback to Document component to be updated on document loading progress. This may come in handy if you load PDF to be displayed from a web server (#238)
  • You can now pass renderMode prop to all Page components by adding it to wrapping Document component instead.
What's changed?
  • Removed max-width from rendered SVG to match Canvas rendering mode behavior (#251).
  • Clarified documentation for onItemClick.
Bug fixes
  • Fixed page not displaying when passed null to scale prop.

4.0.0-beta.2

4 years ago
What's new?
  • You can now use height prop on Page component to scale the page. height will be ignored if you provide width as well. More details in README.md (#236).
Bug fixes
  • Fixed TextLayerItem re-rendering too often (#213, #215). Thanks, @lsimkins!

4.0.0-beta

5 years ago

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

What's new?
  • React-PDF is now fully compatible with React 17 (sic!).
  • Interactive forms can now be rendered by toggling renderInteractiveForms flag.
  • React-PDF now uses new Context API giving it much improved reliability and stability.
What's changed?
  • You can no longer use React-PDF without Web Worker.
  • setOptions function has been replaced with much more powerful options prop in Document component.
Bug fixes
  • Fixed annotation rendering multiple times if an update which does not reset the layout occurs (#192).

3.0.5

5 years ago
Bug fixes
  • Fixed Page and Outline components not accepting pdf prop (#201).

3.0.4

5 years ago
Bug fixes
  • Fixed Page component callbacks like onLoadSucces or onClick not giving access to PDF.js methods like getTextContent (#159).

3.0.3

5 years ago
Bug fixes
  • Fixed Outline not working properly on some PDFs because of Page components not properly being registered.

3.0.2

5 years ago
Bug fixes
  • Fixed AnnotationLayer not scaling with the page properly when Page component was given custom width prop (#173).

3.0.1

5 years ago
Bug fixes
  • Fixed customTextRenderer not getting text item index in itemIndex properly, fixed documentation.

3.0.0

5 years ago

See Upgrade guide from version 2.x to 3.x.

What's new?
  • Context-based architecture. Now, React-PDF's components don't need to be direct descendants of Document component, which makes styling much easier (#124).
  • React-PDF now supports Parcel bundler out of the box (#141).
  • React-PDF now have a set of unit tests to ensure quality and reliability (#125).
  • pageIndex and pageNumber props are now checked better. Now React-PDF will warn you when given pageIndex or pageNumber that does not exist in a given file.
  • Minor performance optimizations when loading a page.
  • Improved performance of SVG rendering when rescaling (#138).
  • Improved rendering performance of Outline.
  • Improved stability of PageAnnotations rendering, especially in non-browser environments.
  • Updated README file to include callbacks from PageAnnotations and PageTextContent components.
  • Updated dependencies of React-PDF as well as of its Sample and Test suites, most notably removed deprecated babel-preset-es2015 in favor of babel-preset-env.
  • You can now use customTextRenderer prop for custom text rendering in Page component (Canvas rendering mode only) (#163). Thanks, @juliakieserman!
What's changed?
  • Messages (loading, error, no data) are now rendered inside their component wrappers, not instead of them.
  • React-PDF class names have been changed to ensure testability and easier styling. For more details, see Upgrade guide for React PDF 2.x users.
  • React-PDF package and its subpackages now all build into dist directories instead of build directories.
  • Annotations stylesheet is not automatically imported anymore. If you'd like to support annotations, you'd need to import it yourself. I you would not, this means less configuration and easier to set up server-side rendering (#133, #140).
Bug fixes
  • Fixed PageSVG not calling onRenderSuccess when rendered page.
  • Fixed unmounting Page component throwing an error when page was not yet loaded.
  • Fixed an issue that could have caused empty page callback in onLoadSuccess.
  • Fixed getPageIndex returning pageIndex higher in priority than pageNumber, when given both.
  • Fixed onLoadSuccess calling onLoadSuccess before state with new pdf has been set, which could result in scripts relying on pdf's existence to fail if they fired too early.
  • Fixed Warning: Failed prop type: text appearing twice in custom PropTypes warning messages.
  • Fixed a configuration bug that could have caused React-PDF to behave unexpectedly on React 15.x environments.

3.0.0-beta

5 years ago
What's new?
  • React-PDF now supports Parcel bundler out of the box (#141).
  • You can now use customTextRenderer prop for custom text rendering in Page component (Canvas rendering mode only) (#163). Thanks, @juliakieserman!
Bug fixes
  • Fixed a configuration bug that could have caused React-PDF to behave unexpectedly on React 15.x environments.

3.0.0-alpha.4

5 years ago

This is an emergency update because of breaking changes introduced in Mozilla's pdfjs-dist, which could have prevented you from using entry.noworker.js.


2.5.3

5 years ago

This is an emergency update because of breaking changes introduced in Mozilla's pdfjs-dist, which could have prevented you from using entry.noworker.js.


3.0.0-alpha.3

5 years ago
What's new?
  • Context-based architecture. Now, React-PDF's components don't need to be direct descendants of Document component, which makes styling much easier (#124).
What's changed?
  • React-PDF package and its subpackages now all build into dist directories instead of build directories.
  • Annotations stylesheet is not automatically imported anymore. If you'd like to support annotations, you'd need to import it yourself. I you would not, this means less configuration and easier to set up server-side rendering (#133, #140).
Bug fixes
  • Fixes React-PDF requiring too high version of React (^16.2 instead of >=15.5).

3.0.0-alpha.2

5 years ago
What's new?
  • Improved performance of SVG rendering when rescaling (#138).
  • Improved rendering performance of Outline.
  • Improved stability of PageAnnotations rendering, especially in non-browser environments.
  • Updated README file to include callbacks from PageAnnotations and PageTextContent components.
  • Updated dependencies of React-PDF as well as of its Sample and Test suites, most notably removed deprecated babel-preset-es2015 in favor of babel-preset-env.
Bug fixes
  • Fix Warning: Failed prop type: text appearing twice in custom PropTypes warning messages.

3.0.0-alpha

5 years ago
What's new?
  • React-PDF now have a set of unit tests to ensure quality and reliability (#125).
  • pageIndex and pageNumber props are now checked better. Now React-PDF will warn you when given pageIndex or pageNumber that does not exist in a given file.
  • Minor performance optimizations when loading a page.
What's changed?
  • Messages (loading, error, no data) are now rendered inside their component wrappers, not instead of them.
  • React-PDF class names have been changed to ensure testability and easier styling. For more details, see Upgrade guide for React PDF 2.x users.
Bug fixes
  • Fixed PageSVG not calling onRenderSuccess when rendered page.
  • Fixed unmounting Page component throwing an error when page was not yet loaded.
  • Fixed an issue that could have caused empty page callback in onLoadSuccess.
  • Fixed getPageIndex returning pageIndex higher in priority than pageNumber, when given both.
  • Fix onLoadSuccess calling onLoadSuccess before state with new pdf has been set, which could result in scripts relying on pdf's existence to fail if they fired too early.

2.5.2

5 years ago
Bug fixes
  • Fix RenderingCancelledExceptions being thrown to the console after PDF.js rendering cancellation handling change (#122).

2.5.1

5 years ago
Bug fixes
  • Fixed an error message "ReferenceError: window is not defined" appearing when using Server Side Rendering (#113).

2.5.0

5 years ago
What's new?
  • Various code optimizations:
    • Improved PDF loading performance.
    • Removed unused pieces of code.
Bug fixes
  • Fixed text layer alignment on PDFs with viewports not aligned with page bonduaries (#100). Thanks, @admehta01!
  • Fixed text layer alignment on PDFs rotated sideways by default (#120).
  • Fixed some unclear pieces of code in Test suite.
  • Fixed unclear error message when trying to read a File on a non-browser environments.

2.4.2

5 years ago
Bug fixes
  • Fixed Document-wide props taking priority over child props. For example, when you wanted to set rotate explicitly for one page, it would get overwritten with global setting (#108).
  • Fixed onDocumentLoad function not bound in example included in README. Thanks, @jkhoang313!

2.4.1

5 years ago
Bug fixes
  • Fix DataCloneError when loading a PDF file from Base64 on Windows 8/8.1 on Internet Explorer (#95).

2.4.0

5 years ago
What's new?
  • Support for internal links (e.g. in table of contents). For them to work you either need to provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.
  • You can now use inputRef prop to pass ref function through <Document> to its root <div> element.
Bug fixes
  • Fix selection sometimes jumping when selecting text (#101).

2.3.0

5 years ago
What's new?
  • Implemented experimental SVG rendering (#55). In the future, SVG renderer will replace current solution, giving excellent performance and accessibility. You can try it out now by setting renderMode to svg in your Page component.
  • You can now set custom options of PDF.js renderer by using setOptions (#85).
    • Support for cMaps which enable rendering non-latin characters (#62).
    • Support for custom location of for PDF.js worker (#84).
  • Updated PDF.js to 2.0.x.
    • As a result, bundle size should be reduced significantly.
Bug fixes
  • Fixed minor accessibility issues in test suite.

2.2.0

5 years ago
What's new?
  • Added support for annotations. This means that active elements like links will now be clickable. You can turn off this feature by setting Page's component renderAnnotations flag to false (#80). Thanks, @flacerdk!
  • You can now pass inputRef to Page and Outline components. inputRef will behave like ref, only it will be applied to root elements returned by these components. This makes things like scrolling to a given page much easier.
  • Errors thrown by React-PDF will now be much more detailed and will include a stack trace. This will help us diagnose potential issues more quickly and make the package better.
  • Updated dependencies.
What's changed?
  • React-PDF no longer have Webpack listed in dependencies.

2.1.7

5 years ago
What's new?
  • react and react-pdf are now properly declared as peerDependencies, not dependencies (#78). Thanks, @iamtommcc!

2.2.0-beta.3

5 years ago
Bug fixes
  • Fixed annotations layer covering up text layer, preventing it from being selectable.

2.2.0-beta.2

5 years ago
Bug fixes
  • Fixed annotations CSS not being added to build folder preventing React-PDF from being used when using its prebuilt version.

2.2.0-beta

5 years ago
What's new?
  • Added support for annotations. This means that active elements like links will now be clickable. You can turn off this feature by setting Page's component renderAnnotations flag to false (#80). Thanks, @flacerdk!
  • You can now pass inputRef to Page and Outline components. inputRef will behave like ref, only it will be applied to root elements returned by these components. This makes things like scrolling to a given page much easier.
  • Errors thrown by React-PDF will now be much more detailed and will include a stack trace. This will help us diagnose potential issues more quickly and make the package better.
What's changed?
  • React-PDF no longer have Webpack listed in dependencies.

2.1.6

5 years ago
What's new?
  • We're using Webpack 3 now!
  • Updated dependencies.
Bug fixes
  • Fixed an issue that caused <PageCanvas> not to be properly updated on scale change.

2.1.5

5 years ago
Bug fixes
  • Recovered compatibility with React <16.0.0 that have been lost in version v2.1.3. Sorry for inconvenience!

2.1.4

5 years ago
What's new?
  • On development builds, React-PDF will now show all errors in the console. There's no more need of catching all errors manually (#73). Thanks for suggestion, @hurkanyakay!
Bug fixes
  • Fixed an issue that caused <Page>'s text content to be misaligned when the page was rotated sideways.

2.1.3

5 years ago
What's new?
  • Updated sample and test suites to use React 16.0.0.
  • Updated dependencies.
  • Updated documentation to note that <Page> components ideally should be a direct children of <Document> component (#65). Thanks, @Anenth!
Bug fixes
  • babel-runtime dependency has been moved from devDependencies to dependencies.

2.1.1

5 years ago
Bug fixes
  • Ensure that non-ES6 environments won't fail because of ES6-only version of merge-class-names.

2.1.0

5 years ago
What's new?
  • Added support for server-side rendering using Node.js.
  • You can now pass custom class names to Document, Page and Outline components (#58).
  • Added support for all mouse events and touch events on Document, Page and Outline components (#59).
  • You can now pass custom children to Page component.
What's improved?
  • Vastly improved performance of loading files via data: URL (side note: that's how files are loaded if you import them using Webpack's file-loader).
Bug fixes
  • Fixed loading file via Blob resulting in callback loop (#54).
  • Fixed small error in sample code in documentation (thanks, @robsco-git!)

2.0.0

5 years ago

See Upgrade guide from version 1.x to 2.x.

What's new?
  • Now there's more React in React. React-PDF's structure has been completely rewritten (#27).
    • Documents are now loaded using Document component.
    • Pages are now rendered in Page components. They are meant to be rendered inside Document component. And yes, this means you can now render many pages at once!
    • You can render now table of contents using Outline component.
  • Support for text layers! This means the text rendered by Page component can be selected or read by a screen reader (nnarhinen/react-pdf#52). Rendering text layer is enabled by default, but you can disable it by using renderTextLayer flag.
  • All React-PDF methods (loadDocument, loadPage etc.) now return a promise for your convenience.
  • onLoadSuccess of Document and Page components now pass pdf and page respectively to their success handlers, giving you access to full PDF.js API.
  • New entry - entry.noloader - which gives you an ability not to create a separate thread for rendering PDFs. See README for more information.
  • React-PDF now respects page's default rotation. In v1.x, rotation was always set to 0 unless rotate prop was passed. Now React-PDF renders pages in their default rotation as defined in PDF file.
  • Default entry will now display a warning if you're developing on a local file system.
  • It's now easier to style No data, Error and Loading messages as they now have their own CSS classes.
  • New sample PDFs were added.
  • README file has been updated.
    • Added instructions for non-Webpack projects.
    • Added instructions for babel-polyfill.
  • Sample and Test pages have been updated.
    • Both pages are now mobile friendly.
    • Sample page now renders an entire PDF at once.
    • Test page now has an Outline section with sample navigation.
  • Optimized NPM package. It no longer includes files not necessary for end user.
Bug fixes
  • Fixed pages rendered sometimes being blurry due to the lack of rounding width/height down.
  • Fixed PDF.js attempting to load worker from a random location (depending on the name of the last script included in head at the moment of loading PDF.js). It is now set to pdf.worker.js (nnarhinen/react-pdf#39).
  • React-PDF will no longer warn Warning: setState(...): Can only update a mounted or mounting component. if you unmount it while loading a file or rendering a page (#43).

2.0.0-beta.5

5 years ago
What's new?
  • Updated dependencies to the newest versions. This also ensures that faulty PDF.js that failed to load files is blocked.
Bug fixes
  • Fixed an issue where empty Document component would fail to render throwing uncaught error.
  • Fixed an issue where onDocumentLoad callbacks were not properly cancelled on unmount, if the latter happened before the page loaded.

2.0.0-beta.4

5 years ago
What's new?
  • npm package is now lighter as it does not contain unnecessary files.
Bug fixes
  • Fixed an edge case where React-PDF was not properly handling a situation when it was immediately unmounted after mounting, which caused React to throw warnings.

2.0.0-beta.3

5 years ago
What's new?
  • babel-polyfill is no longer required to use react-pdf. Thanks, @Kerumen!
  • You can now disable rendering text layers by passing renderTextLayer={false} to Page component.
Bug fixes
  • Fixed an error ReferenceError: regeneratorRuntime is not defined that may have occurred on some environments (#39). Thanks, @Kerumen!

2.0.0-beta.2

5 years ago
What's new?
  • Optimized NPM package. It no longer includes files not necessary for end user.
Bug fixes
  • React-PDF will no longer warn Warning: setState(...): Can only update a mounted or mounting component. if you unmount it while loading a file or rendering a page (#43).

2.0.0-beta

5 years ago
What's new?
  • Updated README file.
    • Added instructions for non-Webpack projects.
    • Added instructions for babel-polyfill.
  • Default entry will now display a warning if you're developing on a local file system.
  • React-PDF will now display a warning if you're developing on a local file system and you're attempting to load a local PDF file.
  • New entry - entry.noloader - which gives you an ability not to create a separate thread for rendering PDFs. See README for more information.
  • All React-PDF methods (loadDocument, loadPage etc.) now return a promise for your convenience.
Bug fixes
  • Fixed React-PDF failing to load if no babel-polyfill was included.
  • Fixed PDF.js attempting to load worker from a random location (depending on the name of the last script included in head at the moment of loading PDF.js). It is now set to pdf.worker.js (nnarhinen/react-pdf#39).

2.0.0-alpha.7

5 years ago
What's new
  • Enhanced text layers alignment.
  • New sample PDFs were added.
Bug fixes
  • Fix Outline component not properly getting item destination from PDF documents created in Microsoft Word.

2.0.0-alpha.5

5 years ago
Bug fixes
  • Fix page rendered too small on HiDPI devices.

2.0.0-alpha.4

5 years ago
Bug fixes
  • Fixed vertical alignment of text layers.

2.0.0-alpha.3

5 years ago
Bug fixes
  • Fix text layers not rotating with the page rotation.
  • PageCanvas component no longer need external CSS to render canvas properly.

2.0.0-alpha.2

5 years ago
What's new?
  • Page component now renders text layers! This means the text can be selected or read by a screen reader (nnarhinen/react-pdf#52).

2.0.0-alpha.1

5 years ago
What's new?
  • You can now render table of contents using new Outline component.
  • It's now easier to style No data, Error and Loading messages as they now have their own CSS classes.
  • Sample and Test pages have been updated.
    • Both pages are now mobile friendly.
    • Sample page now renders an entire PDF at once.
    • Test page now has an Outline section with sample navigation.
Bug fixes
  • Fixed pages rendered sometimes being blurry due to the lack of rounding width/height down.
  • Fixed Page component not showing loader when switching pages.

2.0.0-alpha

5 years ago
What's new?
  • Now there's more React in React. React-PDF's structure has been completely rewritten (#27).
    • Documents are now loaded using Document component.
    • Pages are now rendered in Page components. They are meant to be rendered inside Document component. And yes, this means you can now render many pages at once!
  • onLoadSuccess of Document and Page components now return pdf and page respectively, giving you access to full PDF.js API.
  • React-PDF now respects page's default rotation. In v1.x, rotation was always set to 0 unless rotate prop was passed. Now React-PDF renders pages in their default rotation as defined in PDF file.

1.8.3

5 years ago
Bug fixes
  • Fix an issue with react-pdf test and sample pages using ../ as their React-PDF path, which caused Webpack to fail to build them unless you manually installed Webpack in root project's directory.

1.8.2

5 years ago
Bug fixes
  • Fix an error that resulted in Module not found: 'worker-loader' error on non-Webpack environments.
  • Fix an error that may have occasionally cause React-PDF to fail to load the page.

1.8.1

5 years ago
Bug fixes
  • Fixed an issue that could cause React-PDF to fail on non-ES6 environments.

1.8.0

5 years ago
What's new?
  • You can now rotate the page using prop rotate. See README.md for more details.

113 Versions

TagPublished
6.2.0latest10d ago
6.1.111d ago
6.1.016d ago
6.0.322d ago
6.0.223d ago
6.0.124d ago
6.0.024d ago
6.0.0-beta.6next24d ago
6.0.0-beta.51mo ago
6.0.0-beta.42mos ago
6.0.0-beta.34mos ago
6.0.0-beta.25mos ago
6.0.0-beta5mos ago
5.7.28mos ago
5.7.110mos ago
5.7.010mos ago
5.6.01yr ago
5.5.01yr ago
5.4.11yr ago
5.4.01yr ago
5.4.0-beta.31yr ago
5.4.0-beta.21yr ago
5.3.21yr ago
5.4.0-beta1yr ago
5.3.11yr ago
5.3.02yrs ago
5.3.0-beta.32yrs ago
5.3.0-beta.22yrs ago
5.3.0-beta2yrs ago
5.2.02yrs ago
5.1.02yrs ago
5.1.0-beta2yrs ago
5.0.02yrs ago
5.0.0-beta.52yrs ago
4.2.02yrs ago
5.0.0-beta.42yrs ago
5.0.0-beta.33yrs ago
5.0.0-beta.23yrs ago
5.0.0-beta3yrs ago
4.2.0-beta3yrs ago
4.1.03yrs ago
4.0.54yrs ago
4.0.44yrs ago
4.0.34yrs ago
4.0.24yrs ago
4.0.04yrs ago
3.0.64yrs ago
4.0.0-beta.64yrs ago
4.0.0-beta.54yrs ago
4.0.0-beta.44yrs ago
4.0.0-beta.34yrs ago
4.0.0-beta.24yrs ago
4.0.0-beta5yrs ago
3.0.55yrs ago
3.0.45yrs ago
3.0.35yrs ago
3.0.25yrs ago
3.0.15yrs ago
3.0.05yrs ago
3.0.0-beta5yrs ago
3.0.0-alpha.45yrs ago
2.5.35yrs ago
3.0.0-alpha.35yrs ago
3.0.0-alpha.25yrs ago
3.0.0-alpha5yrs ago
2.5.25yrs ago
2.5.15yrs ago
2.5.05yrs ago
2.4.25yrs ago
2.4.15yrs ago
2.4.05yrs ago
2.3.05yrs ago
2.2.05yrs ago
2.1.75yrs ago
2.2.0-beta.35yrs ago
2.2.0-beta.25yrs ago
2.2.0-beta5yrs ago
2.1.65yrs ago
2.1.55yrs ago
2.1.45yrs ago
2.1.35yrs ago
2.1.15yrs ago
2.1.05yrs ago
2.0.05yrs ago
2.0.0-beta.55yrs ago
2.0.0-beta.45yrs ago
2.0.0-beta.35yrs ago
2.0.0-beta.25yrs ago
2.0.0-beta5yrs ago
2.0.0-alpha.75yrs ago
2.0.0-alpha.55yrs ago
2.0.0-alpha.45yrs ago
2.0.0-alpha.35yrs ago
2.0.0-alpha.25yrs ago
2.0.0-alpha.15yrs ago
2.0.0-alpha5yrs ago
1.8.35yrs ago
1.8.25yrs ago
1.8.15yrs ago
1.8.05yrs ago