Pdf display and iframe issues

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

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.

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

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

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.