ansu5555 / pdf-viewer-reactjs

A simple PDF viewer for React js
https://ansu5555.github.io/pdf-viewer-reactjs/
MIT License
139 stars 64 forks source link

[BUG] cant use on NEXT.JS #73

Open helight59 opened 3 years ago

helight59 commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

How to Reproduce Steps to reproduce the behavior:

  1. add <PDFViewer document={{ url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', }} /> on component.
  2. Run app
  3. Watch logs on terminal

Screenshots image

Details (please complete the following information):

dantman commented 3 years ago

Also cannot be used in CRA.

This appears to be because the library hardcodes the Webpack specific loading for PDF.js. It doesn't allow you to do this yourself and I'm not sure it properly loads the cmaps.

react-pdf handles this by letting you configure PDF.js as you need.