How to use the pdfplumber.from_path 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-basics.py View on Github external
def test_rotation(self):
        rotated = pdfplumber.from_path(
            os.path.join(HERE, "pdfs/nics-background-checks-2015-11-rotated.pdf")
        )
        assert(self.pdf.pages[0].width == 1008)
        assert(self.pdf.pages[0].height == 612)

        assert(rotated.pages[0].width == 612)
        assert(rotated.pages[0].height == 1008)

        assert(rotated.pages[0].cropbox == self.pdf.pages[0].cropbox)
        assert(rotated.pages[0].bbox != self.pdf.pages[0].bbox)
github jsvine / pdfplumber / tests / test-issues.py View on Github external
def test_issue_21(self):
        pdf = pdfplumber.from_path(
            os.path.join(HERE, "pdfs/150109DSP-Milw-505-90D.pdf")
        )
        len(pdf.objects)
github jsvine / pdfplumber / tests / test-issues.py View on Github external
def test_issue_14(self):
        pdf = pdfplumber.from_path(
            os.path.join(HERE, "pdfs/cupertino_usd_4-6-16.pdf")
        )
        len(pdf.objects)
github jsvine / pdfplumber / tests / test-ca-warn-report.py View on Github external
def setUp(self):
        path = os.path.join(HERE, "pdfs/WARN-Report-for-7-1-2015-to-03-25-2016.pdf")
        self.pdf = pdfplumber.from_path(path)
        self.PDF_WIDTH = self.pdf.pages[0].width
github jsvine / pdfplumber / tests / test-nics-background-checks-2015-11.py View on Github external
def setUp(self):
        path = os.path.join(HERE, "pdfs/nics-background-checks-2015-11.pdf")
        self.pdf = pdfplumber.from_path(path)
        self.PDF_WIDTH = self.pdf.pages[0].width
github jsvine / pdfplumber / tests / test-la-precinct-bulletin-2014-p1.py View on Github external
def setUp(self):
        path = os.path.join(HERE, "pdfs/la-precinct-bulletin-2014-p1.pdf")
        self.pdf = pdfplumber.from_path(path)
        self.PDF_WIDTH = self.pdf.pages[0].width
github jsvine / pdfplumber / tests / test-basics.py View on Github external
def setUp(self):
        path = os.path.join(HERE, "pdfs/nics-background-checks-2015-11.pdf")
        self.pdf = pdfplumber.from_path(path)