new interperter

This commit is contained in:
ari committed 2018-12-19 11:24:02 -05:00
1 parent 56dd4c7ef4
commit 1d11cd1c7f
35 files changed
+2781 -2

No files matched your search

+1
View File
@@ -0,0 +1 @@
../pdfmajor
+19
View File
@@ -0,0 +1,19 @@
import os
from pdfmajor.extractor import v2_extract_items_from_pdf
from pdfmajor.interpreter_v2 import PDFText
CUR_PATH = os.path.dirname(os.path.dirname(__file__))
CUR_PATH = os.path.dirname(os.getcwd())
FILE_NAME = os.path.join(
CUR_PATH,
"samples/pdf/fonts.pdf"
)
for page in v2_extract_items_from_pdf(FILE_NAME):
for item in page:
if isinstance(item, PDFText):
print(item.chars)
else:
print(item)