Skip to content

Commit 13e496d

Browse files
authoredJun 25, 2024
Add files via upload
1 parent ee1f487 commit 13e496d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
 

‎printTaxes.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import PyPDF2
2+
3+
def extract_taxes(filename):
4+
5+
# Open the PDF file
6+
pdf = PyPDF2.PdfFileReader(filename)
7+
8+
# Get the first page
9+
page = pdf.getPage(0)
10+
11+
# Extract the taxes from the page
12+
taxes = page.extractText().split(";")
13+
14+
# Return the taxes
15+
return taxes
16+
17+
18+
# Get the filenames of all the PDF files
19+
filenames = ["file1.pdf", "file2.pdf", "file3.pdf"]
20+
21+
# Extract the taxes from all the files
22+
taxes = []
23+
for filename in filenames:
24+
taxes.extend(extract_taxes(filename))
25+
26+
# Print the taxes
27+
print(taxes)

0 commit comments

Comments
 (0)
Please sign in to comment.