-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try use apache batik for example rendering #70
- Loading branch information
Showing
5 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,3 +367,4 @@ dato,usd | |
2017-11,62.71 | ||
2017-12,64.37 | ||
2018-01,69.08 | ||
2018-02,65.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns clj-simple-chart.demo.batikpng | ||
(:import [org.apache.batik.transcoder.image PNGTranscoder] | ||
(org.apache.batik.transcoder TranscoderInput TranscoderOutput) | ||
(java.io StringReader BufferedOutputStream FileOutputStream) | ||
(java.awt Color))) | ||
|
||
(defn write-png [^String s ^String output-filename] | ||
(let [t (doto (PNGTranscoder.) | ||
(.addTranscodingHint PNGTranscoder/KEY_PIXEL_TO_MM (Float. 0.2645833)) ; 96 dpi | ||
(.addTranscodingHint PNGTranscoder/KEY_BACKGROUND_COLOR Color/white))] | ||
(with-open [input (StringReader. s) | ||
output (BufferedOutputStream. (FileOutputStream. output-filename))] | ||
(.transcode t (TranscoderInput. input) (TranscoderOutput. output))))) | ||
|
||
(defn demo [] | ||
(write-png (slurp "img/ssb-svg/nettokontantstraum.svg") "demo.png")) | ||
; MD5 (demo.png) = 014a1215aa4c365462bcdcff920c6f4d on OS X |