PDF in iframe not shown, only pops up external reader

HI,
I tried to show a pdf in an iframe. But it's always opened in the external viewer. How can I change this behaviour?

library(shiny)
ui <- fluidPage(
        sidebarLayout(
            sidebarPanel(
                h5("use case - embed a pdf in the app - embed as a local pdf or from web URL")
            ), 
            mainPanel(
                tabsetPanel(
                    # using iframe along with tags() within tab to display pdf with scroll, height and width could be adjusted
                    tabPanel("Reference", uiOutput("pdfview")),
                    tabPanel("Summary"),
                    tabPanel("Plot")
                )
            ))
        
    )

server <- function(input, output) {
    output$pdfview <- renderUI({
        tags$iframe(style="height:600px; width:100%", src="2558.pdf")
    })
}
shinyApp(ui = ui, server = server)

any ideas?
Thanks,
Christian

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.