Skip to content

Commit

Permalink
Merge pull request #10 from VikParuchuri/dev
Browse files Browse the repository at this point in the history
Fix document loading bug
  • Loading branch information
VikParuchuri authored Oct 8, 2024
2 parents c4f0d34 + 4c61c85 commit 56af2c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions pdftext/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@


def _load_pdf(pdf, flatten_pdf):
if isinstance(pdf, str):
pdf = pdfium.PdfDocument(pdf)

if not isinstance(pdf, pdfium.PdfDocument):
raise TypeError("pdf must be a file path string or a PdfDocument object")
pdf = pdfium.PdfDocument(pdf)

# Must be called on the parent pdf, before the page was retrieved
if flatten_pdf:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pdftext"
version = "0.3.11"
version = "0.3.12"
description = "Extract structured text from pdfs quickly"
authors = ["Vik Paruchuri <vik.paruchuri@gmail.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 56af2c1

Please sign in to comment.