Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I realise that it's nice that it'll give you a single function to dump whatever file format into (while actually running it through a shell command in the backend), but it's not that hard to:

  out = ""
  pdf = pyPdf.PdfFileReader(stream)
  try:
      if pdf.getIsEncrypted():
          pdf.decrypt('')
      for page in pdf.pages:
          out += page.extractText()
  except NotImplementedError:
      # Yeah, this ain't happening


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: