无法显示pdf文件RShiny
当我运行代码并从系统中浏览pdf时,文档查看器会显示“未找到”,尽管其他基于pdf内容创建图形的选项卡工作正常。 我在这里添加代码的相关部分,因为我无法共享整个代码无法显示pdf文件RShiny,r,pdf,shiny,R,Pdf,Shiny,当我运行代码并从系统中浏览pdf时,文档查看器会显示“未找到”,尽管其他基于pdf内容创建图形的选项卡工作正常。 我在这里添加代码的相关部分,因为我无法共享整个代码 ui.R tabItem(tabName="Views", fluidRow( tabBox(width=14,
ui.R
tabItem(tabName="Views",
fluidRow(
tabBox(width=14,
tabPanel(tags$em("Document Viewer",style="font-size:140%"),
column(width = 8,
uiOutput("pdfview"))
)
server <- function(input, output) {
options(shiny.maxRequestSize=800*1024^2)
mypdf_list<-reactive({
inFile <- input$file1
})
observe({
req(input$file1)
pdf_file = readBin(input$file1$datapath, what="character")
})
output$pdfview <- renderUI({
tags$iframe(style="height:600px; width:100%", src="input$file1$datapath")
})
ui.R
tabItem(tabName=“视图”,
fluidRow(
选项卡框(宽度=14,
tabPanel(标记$em(“文档查看器”,style=“font size:140%”),
列(宽度=8,
uiOutput(“pdfview”))
)
应该是src=input$file1$datapath
(无引号)的服务器,但我不确定这是否有效,因为1)Shining将在www子文件夹中搜索此文件,2)这不是HTML文件。这可能有用: