# Pdf display and iframe issues

**URL:** <https://support.openanalytics.eu/t/pdf-display-and-iframe-issues/2743>\
**Category:** ShinyProxy\
**Created:** [March 28, 2024, 7:07pm UTC](https://support.openanalytics.eu/t/pdf-display-and-iframe-issues/2743 "2024-03-28T19:07:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kramerrs](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/kramerrs/32/793_2.png) [@kramerrs](https://support.openanalytics.eu/u/kramerrs)\
**Post date:** [March 28, 2024, 7:07pm UTC](https://support.openanalytics.eu/t/pdf-display-and-iframe-issues/2743/1 "2024-03-28T19:07:28Z")

</div>

I am having an issue with displaying pdfs inline in a shiny app using shinyproxy or displaying pdfs in a new tab. The issue is particularly frustrating because the pdf downloads fine, but is not being shown correctly. The correct number of pages is shown with the pdf, but no content.

I have been able to somewhat isolate the issue to ShinyProxy iframes. EG if I use the app\_direct endpoint rather than the app endpoint the pdf renders.

This was fabulous, except now we don’t have those nice things like error messages and loading spinners.

Here is a tangentially related thread that got me to thinking about using app\_direct in the first place:

[Fledashboard issue with shinyAppDir() for a navbar header embedded app - ShinyProxy - Open Analytics Community Support](https://support.openanalytics.eu/t/fledashboard-issue-with-shinyappdir-for-a-navbar-header-embedded-app/1605)

Other unsuccessful attempts include setting pdf headers and mimetypes, using the application.yml or removing active content. I was able to reproduce the same headers that other pdf websites use, however these did not impact the problem like using the app\_direct endpoint.

---

<div class="post-metadata">

**Author:** ![kramerrs](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/kramerrs/32/793_2.png) [@kramerrs](https://support.openanalytics.eu/u/kramerrs)\
**Post date:** [March 29, 2024, 5:59pm UTC](https://support.openanalytics.eu/t/pdf-display-and-iframe-issues/2743/2 "2024-03-29T17:59:32Z")

</div>

Weird it started working seemingly spontaneously in Edge viewing pdf’s in the /app/ endpoint that is.

---

<div class="post-metadata">

**Author:** ![kramerrs](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/kramerrs/32/793_2.png) [@kramerrs](https://support.openanalytics.eu/u/kramerrs)\
**Post date:** [March 29, 2024, 6:53pm UTC](https://support.openanalytics.eu/t/pdf-display-and-iframe-issues/2743/3 "2024-03-29T18:53:27Z")

</div>

Now it has resumed and I have to use app\_direct, maybe once it is cached it works?

---

<div class="post-metadata">

**Author:** ![kramerrs](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/kramerrs/32/793_2.png) [@kramerrs](https://support.openanalytics.eu/u/kramerrs)\
**Post date:** [April 3, 2024, 8:12pm UTC](https://support.openanalytics.eu/t/pdf-display-and-iframe-issues/2743/4 "2024-04-03T20:12:09Z")

</div>

I think it was the url that we were using for the pdf. We were using relative paths, which would use the app\_proxy and app id, where as if we specified the app\_direct in the source URL it worked. This seemed to be fixed upon loading the app, so if I loaded the app with the app\_direct endpoint, it would got to that URL, even after switching to the app endpoint.
