New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NotImplementedError: only algorithm code 1 and 2 are supported #325
Comments
Hate to be that guy but any update on this? Totally at a loss here. If it helps I'm running on Linux.
and
unfortunately I can not share the original pdf as it contains sensitive data but reading it works fine and https://github.com/jcushman/pdfquery reads and handles it just fine. |
Same here. Please fix |
Hi, here is a file that gives the same error |
I recognized that this is an issue of the dependancy PyPDF2 from 2015. |
thanks for your feedback which prompted me to retry |
Is the PDF encrypted? Can you try decrypting it using |
@vinayak-mehta mine is not encrypted. And as I said pdfquery another Python library can read it just fine. |
I understand. Looked at pdfquery, it looks nice! Interestingly, it also uses pdfminer under the hood. I'll look into this over the weekend. |
Sorry for the late responses to issues. |
Camelot does not support Acrobat files version 6 or higher. Convert your PDF file to a lower version (I used Acrobat 4.0 PDF 1.3) just through any converter online. The problem should be solved! |
@alexxxkorolev thanks for the tip! Any suggestion for a command line tool, preferably Linux, that can downgrade PDFs? The problem is that I use camelot in an automated pipeline and can not manually convert PDFs. |
py-pdf/pypdf#378 (comment) |
Having trouble running this code on my mac. Using Conda virtual env and installed using conda. Pdf is not password protected.
import camelot
import pandas as pd
import re
import numpy as np
table1 = camelot.read_pdf('IEEJ - 2019 - Outlook.pdf')
NotImplementedError Traceback (most recent call last)
in
----> 1 table1 = camelot.read_pdf('IEEJ - 2019 - Outlook.pdf')#, pages = ex_page, password = None)#, area = (left, 112, right,112+ 90))
2 table1
/anaconda3/envs/tensorflow/lib/python3.6/site-packages/camelot/io.py in read_pdf(filepath, pages, password, flavor, suppress_stdout, layout_kwargs, **kwargs)
104 kwargs = remove_extra(kwargs, flavor=flavor)
105 tables = p.parse(flavor=flavor, suppress_stdout=suppress_stdout,
--> 106 layout_kwargs=layout_kwargs, **kwargs)
107 return tables
/anaconda3/envs/tensorflow/lib/python3.6/site-packages/camelot/handlers.py in parse(self, flavor, suppress_stdout, layout_kwargs, **kwargs)
153 with TemporaryDirectory() as tempdir:
154 for p in self.pages:
--> 155 self._save_page(self.filepath, p, tempdir)
156 pages = [os.path.join(tempdir, 'page-{0}.pdf'.format(p))
157 for p in self.pages]
/anaconda3/envs/tensorflow/lib/python3.6/site-packages/camelot/handlers.py in _save_page(self, filepath, page, temp)
98 infile = PdfFileReader(fileobj, strict=False)
99 if infile.isEncrypted:
--> 100 infile.decrypt(self.password)
101 fpath = os.path.join(temp, 'page-{0}.pdf'.format(page))
102 froot, fext = os.path.splitext(fpath)
/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PyPDF2/pdf.py in decrypt(self, password)
1985 self._override_encryption = True
1986 try:
-> 1987 return self._decrypt(password)
1988 finally:
1989 self._override_encryption = False
/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PyPDF2/pdf.py in _decrypt(self, password)
1994 raise NotImplementedError("only Standard PDF encryption handler is available")
1995 if not (encrypt['/V'] in (1, 2)):
-> 1996 raise NotImplementedError("only algorithm code 1 and 2 are supported")
1997 user_password, key = self._authenticateUserPassword(password)
1998 if user_password:
NotImplementedError: only algorithm code 1 and 2 are supported
The text was updated successfully, but these errors were encountered: