sugarshin/react-pdfobject

PDF doesn't automatically render, needs to manually open

davidgtu opened this issue · 1 comments

I have a React app where I get a URL from my server that contains a PDF, and while I can view it, a team member of mine sees it differently. The strange thing is that, for them, it opens normally in other browsers (firefox, safari), but not on Chrome. For me, it works across browsers.

I'm using the library, react-pdfobject

Example (normal):
enter image description here

This is what they see:
enter image description here

Here is my code:

import { PDFObject } from 'react-pdfobject';

// ....
return (
  <>
    <Modal
      {...props}
      width="auto"
      styles={{ body: { height: window.innerHeight - 300 } }}
      onOk={() => {
        if (!data?.me.signatures.length) {
          setNoSignatureModalOpen(true);
          return;
        }
        bulkSignSignableDocuments();
      }}
      okText="Sign"
    >
      <Typography.Title level={4} style={{ textAlign: 'center' }}>
        Review and approve the {documentCount} {documentCount > 1 ? 'documents' : 'document'}{' '}
        you've selected to sign:
      </Typography.Title>
      <div style={{ display: 'flex', height: '100%' }}>
        <DocumentList
          setSelectedDocument={setSelectedDocument}
          preparedDocuments={preparedDocuments}
        />
        {selectedDocument?.pendingSignaturePdfUrl && (
          <PDFContainer>
            <PDFObject url={selectedDocument.pendingSignaturePdfUrl} />
          </PDFContainer>
        )}
      </div>
    </Modal>
    <NoSignatureModal
      open={noSignatureModalOpen}
      onCancel={() => setNoSignatureModalOpen(false)}
    />
  </>
);

How do I get this to automatically open?