How to use the pdfplumber.utils function in pdfplumber

To help you get started, we’ve selected a few pdfplumber examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsvine / pdfplumber / tests / test-ca-warn-report.py View on Github external
def test_pandas(self):

        rect_x0_clusters = utils.cluster_list([ r["x0"]
            for r in self.pdf.pages[1].rects ], tolerance=3)

        v_lines = [ x[0] for x in rect_x0_clusters ]

        def parse_page(page):
            data = page.extract_table({
                "vertical_strategy": "explicit",
                "explicit_vertical_lines": v_lines
            })
            without_spaces = [ fix_row_spaces(row) for row in data ]
            return without_spaces

        parsed = parse_page(self.pdf.pages[0])

        assert(parsed[0] == [
            "NoticeDate",
github jsvine / pdfplumber / pdfplumber / display.py View on Github external
def draw_hlines(self, locations, **kwargs):
        for x in utils.to_list(locations):
            self.draw_hline(x, **kwargs)
        return self