From 60cb358ccee52eae62b3207090d5c5f09c60b4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 9 Sep 2021 14:11:50 +0200 Subject: [PATCH] :bug: Fix extra blank pages when exporting to PDF --- frontend/src/app/main/ui/render.cljs | 4 ++-- frontend/src/app/util/dom.cljs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/render.cljs b/frontend/src/app/main/ui/render.cljs index 59a31d16a8..9cea9c60a6 100644 --- a/frontend/src/app/main/ui/render.cljs +++ b/frontend/src/app/main/ui/render.cljs @@ -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" diff --git a/frontend/src/app/util/dom.cljs b/frontend/src/app/util/dom.cljs index 91ff3ab2e2..5c3074e14a 100644 --- a/frontend/src/app/util/dom.cljs +++ b/frontend/src/app/util/dom.cljs @@ -55,6 +55,10 @@ (.insertAdjacentHTML head "beforeend" (str "")))) (defn get-element-by-class