Skip to content

Commit a701152

Browse files
committed
Add a function to generate a pdf from a fo xml file
1 parent 9bb320e commit a701152

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/clj/catalog/repl.clj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
[catalog.layout.text :as layout.text]
66
[catalog.validation :as validation]
77
[catalog.vubis :as vubis]
8+
[clojure.data.xml :as xml]
9+
[clojure.java.io :as io]
810
[schema.core :as s]))
911

1012
(defn neu-im-sortiment [year issue]
@@ -47,6 +49,13 @@
4749
vubis/order-and-group
4850
(layout.fop/generate-document :grossdruck year issue editorial recommendations out))))
4951

52+
(defn generate-pdf
53+
"Generate the pdf `pdf` for a given xsl-fo XML file `fo-file`"
54+
[fo-file pdf]
55+
(->
56+
(xml/parse (io/reader fo-file))
57+
(layout.fop/generate-pdf! (io/file pdf))))
58+
5059
(defn neu-im-sortiment-text
5160
"Generate plain text for the *Neu im Sortiment* catalog for given
5261
`year` and `issue`"

0 commit comments

Comments
 (0)