Load PDF without iframe

Which product are you using?
PDF.js Express Version

Detailed description of issue
I’m looking for a way to use PDF JS Express without embedding an iframe on the page. Our product allows the user to right-click on the page with our own custom actions added via a SDK script, and the iframe embed blocks the user from interacting in that way. I noticed that following the iframe src path renders the pdf directly on the page without the iframe, so I assume this is possible.

Is there a recommended way to use this component without creating an iframe?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hello Mike,

Unfortunately the iframe is required at the moment, you can read more about it here: What is PDF.js Express? | Documentation

We are planning on removing the iframe requirement from WebViewer later this year.

Best regards,
Tyler Gordon
Web Development Support Engineer


if I understand well you cannot only load the surface of pdf without any frame around and implement your own controls in a layer above? Could you spare some tips on how to approach this problem?

Or if this is what you are working on, then could I ask when are you approximately planning to implement it?

Thanks in advance

Hello m.dousa,

There could be a way to implement PDFJS Express through this sample that puts the pages through HTML elements on the page: GitHub - pdfjs-express/pdfjs-express-custom-ui-sample: A repo showing how to build a custom UI using PDF.js Express workers

Unfortunately we do not have an official way of removing the iframe from the product as it is necessary for operation with the UI and namespaces.

Best regards,
Tyler Gordon
Web Development Support Engineer

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here