2

I need to download as result of my shiny app a PDF where it is print the user selectet text. I do not have idea how to use the downloadHandler for print text Thank you

ui.R

library(shiny)
>
>shinyUI(fluidPage(
 > titlePanel("1.7"),
  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "variable1", label = "seleccione asignatura", choices = c("uno", "diseño máquinas 2", "CADcam", "teoría de mecanismos")),
      selectInput(inputId = "variable2", label = "seleccione profesor", choices = c("profesor 1", "profesor 2", "profesor 3", "profesor 4")),
      selectInput(inputId = "variable3", label = "seleccione especialidad", choices = c("mecánica", "diseño", "posgrado")),
      selectInput(inputId = "variable4", label = "seleccione horario", choices = c("lunes", "martes", "miércoles", "jueves", "viernes"), multiple = TRUE),
      radioButtons(inputId = "variable5", label = "seleccione tipo de formulario", choices = list("formulario 1", "formulario 2")),
      downloadButton('downloadData', 'Download')
    ),
    mainPanel(
      textOutput("text")
    )
  )))

server.R

>library(shiny)

>shinyServer(function(input, output){
>  output$text <- renderText(paste("El profesor",input$variable2,"ha cursado la asignatura de ",input$variable1,"en la especialidad de ",input$variable3,"en los horarios de ",input$variable4))


 > output$downloadData <- downloadHandler(


>    filename = function() {
      paste(input$variable5, "pdf", sep = ".") 

>    },
    #here is where I need help
  >  content = function(file) {
      #no idea
    }
  )
})
D.D.F
  • 21
  • 2
  • Looks like you want to create a pdf file from R. Some ideas here http://stackoverflow.com/questions/3881278/create-a-pdf-table – Xiongbing Jin Apr 08 '16 at 01:39
  • @warmoverflow is correct. You need to create a PDF file using regular non-shiny functions, and then use downloadHandler to point to that file – DeanAttali Apr 09 '16 at 08:29

0 Answers0