add-api-extract-pdf-content
This commit is contained in:
1 parent
4e3358fb1c
commit
ef8f0afa64
7 files changed
+176
-1
No files matched your search
@@ -0,0 +1,9 @@
|
||||
from pdf2image import convert_from_path
|
||||
import pytesseract
|
||||
|
||||
pages = convert_from_path("images/sample.pdf", dpi=300)
|
||||
|
||||
for i, page in enumerate(pages):
|
||||
text = pytesseract.image_to_string(page, config="--psm 6")
|
||||
print(f"--- Page {i+1} ---")
|
||||
print(text)
|
||||
Reference in new issue
Block a user