From a5849277c087c932bfb9187242a80cd279e1bdab Mon Sep 17 00:00:00 2001 From: geisserml Date: Sat, 20 Jan 2024 17:21:02 +0100 Subject: [PATCH] misc improvements --- README.md | 3 ++- setupsrc/pypdfium2_setup/packaging_base.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5066c51d..b93b4d27c 100644 --- a/README.md +++ b/README.md @@ -586,7 +586,8 @@ Nonetheless, the following guide may be helpful to get started with the raw API, height = math.ceil(pdfium_c.FPDF_GetPageHeightF(page)) # Create a bitmap - use_alpha = False # We don't render with transparent background + # (Note, pdfium is faster at rendering transparency if we use BGRA rather than BGRx) + use_alpha = pdfium_c.FPDFPage_HasTransparency(page) bitmap = pdfium_c.FPDFBitmap_Create(width, height, int(use_alpha)) # Fill the whole bitmap with a white background # The color is given as a 32-bit integer in ARGB format (8 bits per channel) diff --git a/setupsrc/pypdfium2_setup/packaging_base.py b/setupsrc/pypdfium2_setup/packaging_base.py index 6c80d2afb..a8221a3ca 100644 --- a/setupsrc/pypdfium2_setup/packaging_base.py +++ b/setupsrc/pypdfium2_setup/packaging_base.py @@ -434,9 +434,8 @@ def run_ctypesgen(target_dir, headers_dir, flags=[], guard_symbols=False, compil assert getattr(ctypesgen, "PYPDFIUM2_SPECIFIC", False), "pypdfium2 requires fork of ctypesgen" import ctypesgen.__main__ - args = ["-l", "pdfium"] - # library loading + args = ["-l", "pdfium"] if run_lds: args += ["--runtime-libdirs", *run_lds] if not allow_system_despite_libdirs: