Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iframe example? #70

Open
travisLilleberg opened this issue May 19, 2021 · 2 comments
Open

iframe example? #70

travisLilleberg opened this issue May 19, 2021 · 2 comments

Comments

@travisLilleberg
Copy link

Hello,

I'm trying to use the viewer inside an iframe and I'm just getting a white box. Could you provide a working example of an iframe using the helper method provided?

My iframe:
<iframe srcdoc="<%= pdfjs_viewer(pdf_url: pdf, style: :minimal) %>"></iframe>

I've also tried escaping the quotes, which loads the html, but the javascript and css don't load:
<iframe srcdoc="<%= pdfjs_viewer(pdf_url: pdf, style: :minimal).gsub('"', '&quot;') %>"></iframe>

Thanks for any help!

@summer-cook
Copy link

@travisLilleberg did you ever figure out how to do this? I get the same issue when trying to use the helper :(

@travisLilleberg
Copy link
Author

travisLilleberg commented Feb 13, 2024

@summer-cook Hi Summer,

Unfortunately I no longer work at the place I was doing this for and I don't remember what we did, but it looks like we forked the repo and made a few changes:

Forked repository: https://github.com/TuftsUniversity/pdfjs_viewer-rails

The commit we added: devisaah@d624c83

You can try using our fork and see if that resolves the issue, but beyond that I honestly don't remember. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants