From ba660af9ebc0a807c72a2fe64a3f1edadac1db9d Mon Sep 17 00:00:00 2001 From: LunarEclipse Date: Sun, 28 Apr 2024 16:52:13 +0200 Subject: [PATCH] small cleanup --- pdf_table_extractor.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pdf_table_extractor.py b/pdf_table_extractor.py index 4ad36d6..8f32663 100644 --- a/pdf_table_extractor.py +++ b/pdf_table_extractor.py @@ -13,8 +13,6 @@ import cairo import fitz -TEST_FILENAME = "/home/luna/Documents/Resources/Praca Licencjacka/sources/2018_Torres-Benitez_Metabolomic analysis Parmotrema.pdf" - Coords: TypeAlias = Tuple[float, float] @@ -31,10 +29,6 @@ class Document: self.selections: Dict[int, List[Selection]] = {} -class State(): - pass - - class PdfPage(Gtk.DrawingArea): def __init__(self, page, *args, **kwargs): super().__init__(*args, **kwargs) @@ -52,6 +46,7 @@ class PdfPage(Gtk.DrawingArea): sctx = widget.get_style_context() Gtk.render_background(sctx, cr, 0, 0, width, height) + pix = self.page.get_pixmap(dpi=96) # type: ignore img = PIL.Image.frombytes("RGBA" if pix.alpha else "RGB", [pix.width, pix.height], pix.samples) img.putalpha(1)