From afedf68415ea2330050f41faeba76a2332509315 Mon Sep 17 00:00:00 2001 From: Charlotte Curtis Date: Mon, 24 Jul 2023 11:00:14 -0600 Subject: [PATCH 1/3] Workaround for #187. --- pdfstitcher/updater.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdfstitcher/updater.py b/pdfstitcher/updater.py index 5f743db..28c3286 100644 --- a/pdfstitcher/updater.py +++ b/pdfstitcher/updater.py @@ -48,6 +48,8 @@ def get_download_url() -> str: if sys.platform == "win32": return gh_prefix + "pdfstitcher.exe" elif sys.platform == "darwin": - return gh_prefix + "PDFStitcher-Installer.dmg" + # for now, just return pdfstitcher.org + # TODO: Determine macOS architecture + return utils.WEB_HOME else: return utils.FLATHUB_HOME From a470e7c877a06dbec5321cad940ada2236beb3cf Mon Sep 17 00:00:00 2001 From: Charlotte Curtis Date: Mon, 24 Jul 2023 11:04:46 -0600 Subject: [PATCH 2/3] Updating processing description on load. Closes #188 --- pdfstitcher/ui/main_frame.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pdfstitcher/ui/main_frame.py b/pdfstitcher/ui/main_frame.py index bde5b02..a2ec34a 100644 --- a/pdfstitcher/ui/main_frame.py +++ b/pdfstitcher/ui/main_frame.py @@ -430,6 +430,9 @@ def load_file(self, pathname, password=""): self.io.do_tile.Disable() self.tt.Disable() + # update the processing description + self.io.on_option_checked(None) + # clear the output if it's already set self.out_doc_path = None From 4fb0579707e037fdf54f45a74a90e010db085b46 Mon Sep 17 00:00:00 2001 From: Charlotte Curtis Date: Mon, 24 Jul 2023 11:10:48 -0600 Subject: [PATCH 3/3] Set default processing to no tiling if first page > A3. Closes #189 --- pdfstitcher/ui/main_frame.py | 9 ++++++++- pdfstitcher/utils.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pdfstitcher/ui/main_frame.py b/pdfstitcher/ui/main_frame.py index a2ec34a..528eaf2 100644 --- a/pdfstitcher/ui/main_frame.py +++ b/pdfstitcher/ui/main_frame.py @@ -422,9 +422,16 @@ def load_file(self, pathname, password=""): # only enable tiling if there are more than one page if len(self.in_doc.pages) > 1: self.tiler = PageTiler() - self.io.do_tile.SetValue(1) self.io.do_tile.Enable() self.tt.Enable() + + # check how big the pages are, and default to no tiling if they're over A3 + first_page = self.in_doc.pages[0] + w, h = utils.get_page_dims(first_page, target_user_unit=1) + if w > 11.7 * 72 or h > 16.5 * 72: + self.io.do_tile.SetValue(0) + else: + self.io.do_tile.SetValue(1) else: self.io.do_tile.SetValue(0) self.io.do_tile.Disable() diff --git a/pdfstitcher/utils.py b/pdfstitcher/utils.py index 291c706..48d5cdc 100644 --- a/pdfstitcher/utils.py +++ b/pdfstitcher/utils.py @@ -308,7 +308,7 @@ def get_page_dims( ) -> tuple[float, float]: """ Helper function to calculate the page dimensions - Returns width, height as observed by the user + Returns width, height in pixels as observed by the user (taking rotation and UserUnit into account) """ # The mediabox is typically specified as