I need to display the RMarkdown Reports in thumbnails. The first report has a red cover, so the thumbnail should be red. The same for the black report. How can I do this?
In addition, each one will be associated with a download button that will download that html file in pdf. How can I associate download button to the html file, to make the download as a pdf file?
Below what I've done so far. Any help guys?
library(shiny)
ui <- fluidPage(
htmlOutput(outputId = 'text_tab_2_comentario'),
downloadButton("downloadData1", "Download Metrics Reports"),
htmlOutput(outputId = 'text_tab_2_comentario2'),
downloadButton("downloadData2", "Download Metrics Reports2")
)
server <- function(input, output, session) {
output$text_tab_2_comentario <- renderUI({
tags$iframe(path = "www/red_report.html")
})
output$text_tab_2_comentario2 <- renderUI({
tags$iframe(path = "www/black_report.html")
})
output$downloadData1 <- downloadHandler(
filename = function(){
paste(Sys.time(), 'black_report.pdf')
},
content = function(file){
pagedown::chrome_print('red_report.html', pdf)
}
)
}
shinyApp(ui, server)