pdf to text using python
by specter - Wednesday June 21, 2023 at 04:39 AM
#1
import os
import pdftotext


pdf_path = input("Enter the path of the pdf file : ")

assert os.path.exists(pdf_path), "this pdf file doesn't exist"

with open(pdf_path, 'rb') as f_r:
    pdf_pages = pdftotext.PDF(f_r)

for i, page in enumerate(pdf_pages):
    print('Page {}'.format(i))
    print(page)
    print('*'*100)
Reply
#2
Oh man!! Python is such an amazing programming language
Reply
#3
Thanks
Reply
#4
Thanks man!
Ban reason: Suspected Scamming | Contact us via http://raiddfzn73ir6iyxlf7nwytnujiflddog...on/contact if you feel this is incorrect. (Permanent)
Reply
#5
Thats very cool share
Ban reason: Selling public data. (Permanent)
Reply
#6
there are many modules to do this, will definitely try this too
Reply
#7
Thanks man
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python pathlib: suffix, suffixes and stem for compound filenames nolookshot 0 188 10-16-2026, 02:41 PM
Last Post: nolookshot
  Python timezone-aware timestamps versus elapsed durations nolookshot 0 101 10-16-2026, 02:40 PM
Last Post: nolookshot
  Python CSV: handling quoted commas and embedded newlines nolookshot 0 109 10-16-2026, 02:39 PM
Last Post: nolookshot
  Retrieving Firefox Cookies Using Python Aurora 15 6,031 09-10-2026, 03:29 AM
Last Post: realtruth
  [Tutorial] Bruteforce Any RDP Using Python 0x666 56 6,542 02-08-2026, 02:17 PM
Last Post: lombardi



 Users browsing this thread: 1 Guest(s)