react-doc-viewer icon indicating copy to clipboard operation
react-doc-viewer copied to clipboard

Can't view Word files

Open alvaro1728 opened this issue 1 year ago • 3 comments

Hi, I'm pointing to a Word file (.docx) and it first shows an animation: image Then after about 3 seconds, I get this error: image The browser inspector shows a bunch of network calls, some which succeed and others that fail with a 404. The 404 calls look like this:

  • https://pus7-word-view.officeapps.live.com/wv/ResReader.ashx?n=p1.img&WOPIsrc=http%3A%2F%2Fpus7%2Dview%2Dwopi%2Ewopi%2Eonline%2Eoffice%2Enet%3A808%2...
  • https://pus7-word-view.officeapps.live.com/wv/docdatahandler.ashx?WOPIsrc=http%3A%2F%2Fpus7%2Dview%2Dwopi%2Ewopi%2Eonline%2Eoffice...

Does anyone know what the problem is? BTW, Excel files (.xlsx) work fine.

Thanks, Alvaro

alvaro1728 avatar Sep 08 '23 18:09 alvaro1728

I am facing the same issue, Please Let me know if you find any solution or alternative.

hassaan-tech avatar Nov 07 '23 10:11 hassaan-tech

Same issue here. Any update on a fix? I did find a workaround. You can create a customer renderer with the https://docs.google.com/gview instead. Something like this:

const GoogleDocsViewerRenderer = ({
  mainState: { currentDocument }
}) => {
  if (!currentDocument || !currentDocument.uri) return null
  const viewerUrl = `https://docs.google.com/gview?url=${encodeURIComponent(
    currentDocument.uri
  )}&embedded=true`

  return (
    <iframe
      src={viewerUrl}
      style={{ width: '100%', height: '80vh', border: 'none' }}
      frameBorder="0"
    ></iframe>
  )
}

GoogleDocsViewerRenderer.fileTypes = [
  'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  'application/vnd.openxmlformats-officedocument.spreadsheetml.presentation'
]
GoogleDocsViewerRenderer.weight = 10

TrevHeath avatar Nov 30 '23 18:11 TrevHeath

Hi, I'm pointing to a Word file (.docx) and it first shows an animation: image Then after about 3 seconds, I get this error: image The browser inspector shows a bunch of network calls, some which succeed and others that fail with a 404. The 404 calls look like this:

  • https://pus7-word-view.officeapps.live.com/wv/ResReader.ashx?n=p1.img&WOPIsrc=http%3A%2F%2Fpus7%2Dview%2Dwopi%2Ewopi%2Eonline%2Eoffice%2Enet%3A808%2...
  • https://pus7-word-view.officeapps.live.com/wv/docdatahandler.ashx?WOPIsrc=http%3A%2F%2Fpus7%2Dview%2Dwopi%2Ewopi%2Eonline%2Eoffice...

Does anyone know what the problem is? BTW, Excel files (.xlsx) work fine.

Thanks, Alvaro

Same issue here, @cyntler any updates on the issue please.

ridwannizam avatar Dec 10 '23 20:12 ridwannizam