简体   繁体   中英

How can I generate a PDF of the dashboardBody of a shinydashboard?

I have a dashboard written in R using the shiny and shinydashboard packages. Such a dashboard consists of a header, sidebar, and body. Here is a minimalistic example:

library(shinydashboard)

ui <- dashboardPage(
  header = dashboardHeader(),
  sidebar = dashboardSidebar(),
  body = dashboardBody(h2("This goes into the PDF."))
)

shinyApp(ui = ui, server = function(input, output) {})

I would like to export the body of the dashboard into PDF. That is actually the default action when printing the dashboard opened in Safari.

However, I would like to programmatically export the body of the dashboard into PDF. How can I write such a function in R or Javascript?

我前段时间遇到过这个问题,我发现如果你通过浏览器打开你的应用程序,当使用浏览器工具打印时,它只会按照要求打印正文。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM