I'm currently writing an R package that includes a Shiny app. I'm trying to include a PDF resource in the app and I found code on how to do that using 'tags$iframe'.
shiny::mainPanel( shiny::tabsetPanel(type = 'tab', shiny::tabPanel('Examples', tags$iframe(style = 'height:400px; width:100%; scrolling=yes', src = 'https://lucidviews.github.io/repvisforODK/docs/example_plots_repvis.pdf')))
As you can see in the code snippet I'm defining the src parameter with a link to my GitHub page. I do this because it ensures that I'm fetching the raw version of the PDF file. If you use the URL in browser everything can be accessed perfectly. However, my app doesn't show the document.
To reproduce the issue:
- Download the package from GitHub using
# install.packages("devtools") devtools::install_github("lucidviews/repvisforODK")
go to lucidviews/repvisforODK: Generic R package to analyse ODK data (github.com) and download the ui.R, server.R and run_app.R files.
Run the function run_app()
(If you went for the second option in 1. you need to run the functions in the ui and server file first and then you can execute the function in run_app.R)
Go to the second tab panel called '2. Select Visualisations'. Here you see that the PDF file is not displayed.
I'm thankful for any help (-: