title: How to display a pdf that has been downloaded in python
body: <p>I have grabbed a pdf from the web using for example</p>
  
  <pre><code>import requests
  pdf = requests.get("http://www.scala-lang.org/docu/files/ScalaByExample.pdf")
  </code></pre>
  
  <p>I would like to modify this code to display it</p>
  
  <pre><code>from gi.repository import Poppler, Gtk
  
  def draw(widget, surface):
      page.render(surface)
  
  document = Poppler.Document.new_from_file("file:///home/me/some.pdf", None)
  page = document.get_page(0)
  
  window = Gtk.Window(title="Hello World")
  window.connect("delete-event", Gtk.main_quit)
  window.connect("draw", draw)
  window.set_app_paintable(True)
  
  window.show_all()
  Gtk.main()
  </code></pre>
  
  <p>How do I modify the <code>document =</code> line to use the variable pdf that contains the pdf?</p>
  
  <p>(I don't mind using popplerqt4 or anything else if that makes it easier.)</p>