Comments (8)
Okay got it :
Worked this way :
Give fileType
fileType: 'docx'
const urlData = !!path ? [{ uri: path, fileType: 'docx' }] : [];
<DocViewer
className="doc-viewer"
documents={urlData}
config={{
header: {
disableHeader: false,
disableFileName: false,
retainURLParams: false,
},
}}
pluginRenderers={DocViewerRenderers}
/>
from react-doc-viewer.
@milinkovitch can you tell me when you were having this cors issues and how did you fixed it.Thanks.
from react-doc-viewer.
I have the same problem. I'm using sample pdf file and it gives me CORS error in console and the loader for pdf file keeps loading forever. Ideally it should display error message - Couldn't load pdf file
.
const docs = [ { uri: "http://www.africau.edu/images/default/sample.pdf", fileType: "pdf", }, ];
from react-doc-viewer.
same
from react-doc-viewer.
I have the same problem, please help!!!
from react-doc-viewer.
All you need to do is pass in the fileType and URI, I had the same issue but got it working by passing only these two. I was previously passed the URI only
from react-doc-viewer.
fileType guys, fileType. It's a must.
from react-doc-viewer.
import DocViewer, { PDFRenderer } from "react-doc-viewer";
const show = () => {
const docs = [
{ uri: "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", fileType: "pdf", },
];
return <DocViewer documents={docs} pluginRenderers={[PDFRenderer]} />
}
export default show
use this still cors
from react-doc-viewer.
Related Issues (20)
- xlsx,docx,not supporting HOT 6
- Support CSV HOT 1
- Language recognition error
- Uncaught ReferenceError: DataStream is not defined
- file type
- Can not load different files of same type
- Relative imports outside of src/ are not supported HOT 1
- Charge Money
- resolve you may need an appropriate loader to handle this file type , currently no loaders are configured to process this file."
- Could not open file using S3 signed URL HOT 6
- window is not defined in SSR HOT 3
- Error: Invalid hook call. Hooks can only be called inside of the body of a function component. HOT 3
- local files not rendering HOT 2
- For PDF Files, set a default Zoom level
- DOMException: The user aborted a request. HOT 1
- how to add custom zoom ?
- Support for AWS.storage.geturl() HOT 1
- XLSX, DOCX, PPTX not working HOT 1
- Docx, Doc file is not working i am passing base64data URI
- Doc viewer buttons submit form
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-doc-viewer.