This commit is contained in:
Jimmy Xiang
2019-10-28 17:23:05 +08:00
parent 9281cb885a
commit 10418167b3
6 changed files with 16 additions and 0 deletions

BIN
pdf/01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
pdf/02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
pdf/03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
pdf/04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

16
pdf/pdf.py Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python3
import pdfplumber
import pandas as pd
with pdfplumber.open("test.pdf") as pdf:
first_page = pdf.pages[0]
text = first_page.extract_text()
print(text)
second_page = pdf.pages[1]
table = second_page.extract_tables()
for t in table:
df = pd.DataFrame(t[1:],columns=t[0])
print(df)

BIN
pdf/test.pdf Normal file

Binary file not shown.