Can't reach inner document in object tag in React

Viewed 193

I'm trying to make a preview of a pdf document using only the object or iframe tag. My goal is to remove the toolbar and the scrollbar and correctly move the file to have a good looking image of my first pdf page. For such needs I need to apply css to some part of my document like "#outerContainer #mainContainer div.toolbar".

The problem is that I can't reach those components and I don't understand why. I have tried to apply directly new class to the component but nothing happened or to switch to iframe tag.

I also went through different topics like this one : Access <object> data with JavaScript and I saw that my contentDocument is undefined

Here is a link to a sandbox demonstrating my attempt to access the inner document: https://codesandbox.io/s/keen-cloud-z9gtf?file=/src/PDFObject.tsx

Thanks for your future help !

0 Answers
Related