                 layers (layer-model/find-by-document layer-db doc)]
             {:status 200
              :headers (merge {"Content-Type" "application/pdf"}
+                             (when (-> req :params :dl)
+                               {"Content-Disposition" (format "attachment; filename=\"precursor-document-%s.pdf\""
+                                                              (:db/id doc))})
                              (image-cache-headers layer-db doc))
              :pc/doc doc
              :body (convert/svg->pdf (render/render-layers layers

                  layers (layer-model/find-by-document layer-db doc)]
              {:status 200
               :headers (merge {"Content-Type" "image/svg+xml"}
                               (image-cache-headers layer-db doc))
               :pc/doc doc
               :body (render/render-layers layers :invert-colors? (-> req :params :printer-friendly (= "false")))}))

                  layers (layer-model/find-by-document layer-db doc)]
              {:status 200
               :headers (merge {"Content-Type" "image/png"}
                               (when (-> req :params :dl)
                                 {"Content-Disposition" (format "attachment; filename=\"precursor-document-%s.png\""
                                                                (:db/id doc))})
                               (image-cache-headers layer-db doc))
               :pc/doc doc
               :body (convert/svg->png (render/render-layers layers
