1
사용자로부터 PDF 파일을 읽고 표시하기위한 R의 간단한 반짝이는 앱이 있습니다. 나는 그것이 작동하도록 할 수 없습니다. www 디렉토리에 반짝 서버에서 난 그냥 첫 번째 문자업로드 및 R 반짝이의 PDF보기
library(shiny)
ui <- shinyUI(fluidPage(
titlePanel("Testing File upload"),
sidebarLayout(
sidebarPanel(
fileInput('file_input', 'upload file (. pdf format only)', accept = c('.pdf'))
),
mainPanel(
uiOutput("pdfview")
)
)
))
server <- shinyServer(function(input, output) {
observe({
req(input$file_input)
test_file <- readBin(input$file_input$datapath, what="character")
writeBin(test_file, "www/myreport.pdf")
})
output$pdfview <- renderUI({
tags$iframe(style="height:600px; width:100%", src="myreport.pdf")
})
})
shinyApp(ui = ui, server = server)
신난다! 감사. 이것은 효과가 있었다. –
@VishalVerma이 작업이 완료되면 upvote 및 답변 표시 허용하십시오! 고마워 – amrrs