peterdesmet / petridish

Jekyll theme for research project websites 🧫
https://peterdesmet.github.io/petridish
MIT License
52 stars 44 forks source link

Embed PDF on page #75

Closed jocelynpender closed 1 year ago

jocelynpender commented 1 year ago

Is there a recommended way to embed a PDF document on a page? Ideally, a viewer would be embedded, which would allow the user to scroll through the PDF via the viewer, similar to how I've implemented an embedded Google Sheet on this page: https://atlantichabitatmodels.github.io/communityofpractice/directory/

It looks like I can use an iframe to call Google's viewer (found on this stack overflow page). <iframe src="https://docs.google.com/gview?url=http://example.com/mypdf.pdf&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe> I'm wondering if there's a more Jekyll-themey way of doing this?

peterdesmet commented 1 year ago

Don't know of preferred ways to embed. Personally I would just link to the pdf, optionally with the option to open a new tab:

[see this pdf](link-to-pdf){: target="_blank"}

Browsers typically render pdfs nicely and offer options to download. The user is then also not restricted by the rather narrow width of the site it is embedded in.