Select Page

While creating a special theme for a website usoing custom post types with a lot of media attachted it was needed to display pdf-files directly on the browser screen with html, css and javascript creating a custom overlay. I found different options and wanted to keep track of the options in this post.

Object embed

https://stackoverflow.com/questions/9840230/how-to-display-a-pdf-stream-in-a-browser-using-javascript#9840403

Iframe

https://www.w3docs.com/snippets/html/how-to-embed-pdf-in-html.html