 (defn svg-to-jpg [svg widht height force-transparent-white quality]
   (try
     (with-open [out (new ByteArrayOutputStream)]
-      (let [svg (-> svg remove-cursor remove-empty-img replace-rgba)
+      (let [svg (clear-svg svg)
             string-reader (new StringReader svg)
             transcoder-input (new TranscoderInput string-reader)
             transcoder-output (new TranscoderOutput out)

(defn- remove-cursor [svg]
  (clojure.string/replace svg #"cursor\s*:\s*[\w-]+\s*;?\s*" ""))

;====================================================================================
; SVG --> PDF
;====================================================================================

      (clojure.string/replace #"stroke=\"rgba\(([^,\)]*),([^,\)]*),([^,\)]*),([^,\)]*)\)\""
                              "stroke=\"rgb($1,$2,$3)\" stroke-opacity=\"$4\"")))

(defn- trim-svg-string [str]
  (let [left-trim-str (clojure.string/replace str #"^\"" "")
        right-trim-str (clojure.string/replace left-trim-str #"\"$" "")]
