-1

How can you read and change the x / y coordinates of a PDF in an iframe, my iframe looks like this: <iframe id="pdf-interface" class="pdf-interface" src=path></iframe> where path is the local path to the PDF file.
All attempts I've tried until now failed with the error message: Uncaught DOMException: Blocked a frame with origin "http://127.0.0.1:8080" from accessing a cross-origin frame.
Is there any way to fix this or an alternative way of doing this?

sideshowbarker
  • 62,215
  • 21
  • 143
  • 153

1 Answers1

0

You can't access cross-origin iframes directly.

Read more about it on Quentin's answer https://stackoverflow.com/a/66139466/7942242

And Willy Wonka's answer might interest you as well https://stackoverflow.com/a/39685594/7942242 which has a reference about how to bypass Same Origin Policy.

crg
  • 2,088
  • 1
  • 8
  • 27
  • I'll look into it, shame that there is no way to at least read out the page number of a pdf, this makes an iframe for PDFs kind of useless in my opinion – Paul Müller May 21 '21 at 22:33