mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
Merge pull request #8289 from penpot/niwinz-staging-exporter-fix
🐛 Fix issue with pdf render on exporter
This commit is contained in:
commit
ccfee34e76
@ -41,14 +41,20 @@
|
|||||||
(sync-page-size! [dom]
|
(sync-page-size! [dom]
|
||||||
(bw/eval! dom
|
(bw/eval! dom
|
||||||
(fn [elem]
|
(fn [elem]
|
||||||
|
;; IMPORTANT: No CLJS runtime allowed. Use only JS
|
||||||
|
;; primitives. This runs in a context without access to
|
||||||
|
;; cljs.core. Avoid any functions that transpile to
|
||||||
|
;; cljs.core/* calls, as they will break in the browser
|
||||||
|
;; runtime.
|
||||||
|
|
||||||
(let [width (.getAttribute ^js elem "width")
|
(let [width (.getAttribute ^js elem "width")
|
||||||
height (.getAttribute ^js elem "height")
|
height (.getAttribute ^js elem "height")
|
||||||
style-node (let [node (.createElement js/document "style")]
|
style-node (let [node (.createElement js/document "style")]
|
||||||
(.appendChild (.-head js/document) node)
|
(.appendChild (.-head js/document) node)
|
||||||
node)]
|
node)]
|
||||||
(set! (.-textContent style-node)
|
(set! (.-textContent style-node)
|
||||||
(str "@page { size: " width "px " height "px; margin: 0; }\n"
|
(dm/str "@page { size: " width "px " height "px; margin: 0; }\n"
|
||||||
"html, body, #app { margin: 0; padding: 0; width: " width "px; height: " height "px; overflow: visible; }"))))))
|
"html, body, #app { margin: 0; padding: 0; width: " width "px; height: " height "px; overflow: visible; }"))))))
|
||||||
|
|
||||||
(render-object [page base-uri {:keys [id] :as object}]
|
(render-object [page base-uri {:keys [id] :as object}]
|
||||||
(p/let [uri (prepare-uri base-uri id)
|
(p/let [uri (prepare-uri base-uri id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user