react-doc-viewer
react-doc-viewer copied to clipboard
Can't view Word files
Hi, I'm pointing to a Word file (.docx) and it first shows an animation:
Then after about 3 seconds, I get this error:
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
I am facing the same issue, Please Let me know if you find any solution or alternative.
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
Hi, I'm pointing to a Word file (.docx) and it first shows an animation:
Then after about 3 seconds, I get this error:
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.