mirror of
https://codeberg.org/privacy1st/pdf-replace
synced 2024-11-22 22:09:35 +01:00
20 lines
324 B
Python
20 lines
324 B
Python
|
from pathlib import Path
|
||
|
|
||
|
from pypdf import PdfReader
|
||
|
|
||
|
|
||
|
def main():
|
||
|
"""
|
||
|
Print text from all pages of PDF file.
|
||
|
"""
|
||
|
file = Path("pdf.pdf")
|
||
|
|
||
|
# Print text of all PDF pages.
|
||
|
reader = PdfReader(file)
|
||
|
for page in reader.pages:
|
||
|
print(page.extract_text())
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|