Alcumus / react-doc-viewer

Apache License 2.0
255 stars 106 forks source link

Not able to load PDF or Word doc #162

Open nikhilguptagl opened 3 months ago

nikhilguptagl commented 3 months ago

I am using this code to load a pdf,

import DocViewer, { DocViewerRenderers } from 'react-doc-viewer';

function DocViewerFile() {
  const docs = [
    {
      uri: 'http://10.6.0.220/testing2/560RCR01_DS_en.pdf',
    },
  ];

  return <DocViewer pluginRenderers={DocViewerRenderers} documents={docs} />;
}

export default DocViewerFile;

but I am not able to load that pdf on browser. This is the screenshot - image

http://10.6.0.220/testing2/560RCR01_DS_en.pdf is the valid link- I see a PDF on the browser when I put this URL in the browser directly.

Any idea, what is missing here.

girmahertali commented 2 months ago

I'm trying to use the above package but, I'm having same issue me too

rsun-babu commented 1 month ago

pdfjs-dist folder is missing under utils.

Tried copying the files and folder which is visible in node_modules [in the same heirarchy of the build folder]. Didnt work

8