0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 00:01:51 -05:00

🐛 Fix extra blank pages when exporting to PDF

This commit is contained in:
Andrés Moya 2021-09-09 14:11:50 +02:00
parent f03a74abc7
commit 60cb358cce
2 changed files with 6 additions and 2 deletions

View file

@ -80,8 +80,8 @@
(mf/use-effect
(mf/deps width height)
#(dom/set-page-style {:size (str (mth/round width) "px "
(mth/round height) "px")}))
#(dom/set-page-style {:size (str (mth/ceil (+ width padding padding)) "px "
(mth/ceil (+ height padding padding)) "px")}))
[:& (mf/provider embed/context) {:value true}
[:svg {:id "screenshot"

View file

@ -55,6 +55,10 @@
(.insertAdjacentHTML head "beforeend"
(str "<style>"
" @page {" style-str "}"
" html, body {" ; Fix issue having Chromium to add random 1px marging at the bottom
" overflow: hidden;" ; https://github.com/puppeteer/puppeteer/issues/2278#issuecomment-410381934
" font-size: 0;"
" }"
"</style>"))))
(defn get-element-by-class