Hello ,
We are currently working on a react web application and we want to display a pdf from a remote server on our web page using React-PDF but it didn't work, it always downloads the file rather than displaying it ..and it shows the folloing error: Unexpected server response (204) while retrieving PDF .. Can you please help us out?
EDIT: IDM was the problem preventing the pdf from displaying.
I succeeded to display the pdf by disabing the IDM.
We’ve found the following line in google inspect element tool: 204 Intercepted by the IDM Advanced Integration
Is there any way to ignore/disable IDM when running the React app ?
Hello , We are currently working on a react web application and we want to display a pdf from a remote server on our web page using React-PDF but it didn't work, it always downloads the file rather than displaying it ..and it shows the folloing error: Unexpected server response (204) while retrieving PDF .. Can you please help us out?
EDIT: IDM was the problem preventing the pdf from displaying. I succeeded to display the pdf by disabing the IDM.
We’ve found the following line in google inspect element tool: 204 Intercepted by the IDM Advanced Integration
Is there any way to ignore/disable IDM when running the React app ?
Here is our implementation of React-PDF:
import React, { Component } from "react"; //import { Document, Page } from "react-pdf"; import { Document, Page, pdfjs } from "react-pdf"; import PropTypes from "prop-types"; import { connect } from "react-redux"; class PDFShow extends Component { constructor(props) { super(props); this.state = { numPages: null, pageNumber: 1 }; } onDocumentLoadSuccess = ({ numPages }) => { this.setState({ numPages }); }; render() { pdfjs.GlobalWorkerOptions.workerSrc =
//cdnjs.cloudflare.com/ajax/libs/pdf.js/${ pdfjs.version }/pdf.worker.js
;} } PDFShow.propTypes = { currentResource: PropTypes.object.isRequired };
const mapStateToProps = state => ({ currentResource: state.currentResource }); export default connect( mapStateToProps, {} )(PDFShow);