Skip to content
Discussion options

You must be logged in to vote

Turns out the object needs to be in an element with height, or have a style to declare height. This is a chrome-specific issue. Firefox showed the toolbar the whole time, and Safari showed its overlay. Both of these work for Chrome:

<div style={{height: '80vh', width: '100%'}}>
  <object
    data={pdfData}
    type="application/pdf"
    width="100%"
    height="100%"
  >
    <p>Unable to display PDF.</p>
  </object>
</div>

or

  <object
    data={pdfData}
    style={{height: '80vh', width: '100%'}}
    type="application/pdf"
    width="100%"
    height="100%"
  >
    <p>Unable to display PDF.</p>
  </object>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cade-rea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant