title: In a shiny app how can I force and embedded pdf viewer to refresh when the source file changes
body: <p>I have used <a href="https://stackoverflow.com/questions/19469978/displaying-a-pdf-from-a-local-drive-in-shiny">this answer</a> to embed a pdf in my shiny app. When I first generate the pdf through shiny UI inputs and "submit" with an action button the pdf is generated from the UI inputs and displays in the Viewer fine.</p>
  
  <p>However when I change the document through the UI and and submit again the viewer still displays the old report even though the file contents have changed.</p>
  
  <p>How can I force it to display the new pdf?</p>
  
  <p>This is reproducible example of my problem, works best when opened in browser.</p>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  
  shinyUI(fluidPage(
  
    # Application title
    titlePanel("Old Faithful Geyser Data"),
  
    # Sidebar with a slider input for number of bins
    sidebarLayout(
      sidebarPanel(
        textInput("textin", label = "text input")
        , actionButton("makepdf", "Make pdf")
      ),
  
      mainPanel(
        htmlOutput("pdfviewer")
      )
    )
  ))
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>library(shiny)
  shinyServer(function(input, output) {
  observeEvent(input$makepdf,{
    title &lt;- input$textin
    print(title)
    pdf("www/test.pdf")
    plot(mtcars$mpg,mtcars$disp, main = title)
    dev.off()
  })
  
  
   observeEvent(input$makepdf,({
     output$pdfviewer &lt;-renderText({
      return(paste('&lt;iframe style="height:600px; width:100%" src="'," test.pdf", '"&gt;&lt;/iframe&gt;', sep = ""))
      })
    })
  )
  
  })
  </code></pre>
  
  <p>Steps to reporoduce:</p>
  
  <ol>
  <li>Launch app in browser</li>
  <li>Type anything in the "text input" box and click "Make pdf"</li>
  <li>Type something different in the "text input" box and click "Make pdf"</li>
  <li>Observe the pdf viewer still shows output from step 2 even though the source file in your www folder will display the change made in step 3.</li>
  </ol>