   (:require [clojure.string :as s]
             [clojure.java.io :as io]
             [pepa.util :refer [slurp-bytes run-process with-temp-file]])
-  (:import java.lang.ProcessBuilder))
+  (:import java.lang.ProcessBuilder
+           java.io.File))
 
 (declare make-reader)
 

  "Extracts PAGE (a number) from PDF (input-stream). Returns a file.
  Caller must delete this file when it's no longer needed."
  [file page]
  (let [tmp-file (java.io.File/createTempFile "pdfseparate-" ".pdf")
        page (inc page)
        args ["-f" page
              "-l" page

          file-type (case file-type
                      ;; NOTE: Always use "." here. See note below.
                      :png "png")
          tmp-file (File/createTempFile "pdftocairo" (str "." file-type))]
      (try
        (let [args [(str file)
                    (str "-" file-type) ;-png flag
