HACKER Q&A
📣 WheelsAtLarge

Best way to convert PDFs to other file formats?


Some types of PDFs have always been a challenge to convert to other file formats like Word or plain text. I've had many go from perfectly formatted PDFs to useless text when converted.

Has anyone found a good converter? In the age of AI, you would think that there would be a foolproof way to do it.


  👤 bluehorseray Accepted Answer ✓
pdftotext in python works pretty well:

  import pdftotext
  import sys
  
  with open("test.pdf", "rb") as f:
    pdf = pdftotext.PDF(f,physical=True)

  for page in pdf:
    print(page)

👤 sarcasmatwork
calibre? (https://calibre-ebook.com)

You can convert various types of ebooks.