Skip to content
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

Can't open PDF imported from Adobe Digital Editions #115

Closed
aleguizzo opened this issue Aug 4, 2022 · 2 comments
Closed

Can't open PDF imported from Adobe Digital Editions #115

aleguizzo opened this issue Aug 4, 2022 · 2 comments

Comments

@aleguizzo
Copy link

Question / bug report

I've imported an Adobe Digital Editions PDF in calibre, but the cover doesn't show up and when I try to open the book with the integrated reader it gives me the error message that I've pasted in the log field of this bug report. I've imported the keys in the settings. I've tried directly with the DeACSM plugin that you've suggested in another bug report, the book downloads but doesn't open. The book reads fine in Adobe Digital Editions.

I remember doing this with a similar ebook two years ago, with the original maintainer's DeDRM Tools and it worked, but if I try now with that ebook it gives me the same issue.

Which version of Calibre are you running?

6.2.1

Which version of the DeDRM plugin are you running?

v10.0.3

If applicable, which version of the Kindle software are you running?

No response

Log output

calibre, version 6.2.1
ERRORE: Caricamento libro fallito: Impossibile aprire il libro in /Users/aleg/Biblioteca di calibre/Sconosciuto/Antiriciclaggio 2019 (45)/Antiriciclaggio 2019 - Sconosciuto.pdf. Fai clic su "Mostra dettagli" per ulteriori informazioni.

Failed to convert book: /Users/aleg/Biblioteca di calibre/Sconosciuto/Antiriciclaggio 2019 (45)/Antiriciclaggio 2019 - Sconosciuto.pdf with error:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 435, in get_file_type_metadata
  File "calibre/customize/builtins.py", line 323, in get_metadata
  File "calibre/ebooks/metadata/pdf.py", line 124, in get_metadata
ValueError: Could not read info dict from PDF
DeDRM v10.0.3: Trying to decrypt Antiriciclaggio 2019 - Sconosciuto.pdf
DeDRM v10.0.3: Antiriciclaggio 2019 - Sconosciuto.pdf is a PDF ebook with encryption EBX_HANDLER
DeDRM v10.0.3: Antiriciclaggio 2019 - Sconosciuto.pdf is a PDF ebook (EBX) for UUID 856220d4-003a-46ac-9574-93b90d8d92f6
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "encodings/hex_codec.py", line 19, in hex_decode
ValueError: string argument should contain only ASCII characters

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "calibre/customize/ui.py", line 178, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1063, in run
    decrypted_ebook = self.PDFDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 923, in PDFDecrypt
    return self.PDFIneptDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 695, in PDFIneptDecrypt
    userkey = codecs.decode(userkeyhex, 'hex')
ValueError: decoding with 'hex' codec failed (ValueError: string argument should contain only ASCII characters)
Syntax Error: Couldn't find the 'EBX_HANDLER' security handler
pdfinfo errored out with return code: 1
InputFormatPlugin: PDF Input running
on /Users/aleg/Biblioteca di calibre/Sconosciuto/Antiriciclaggio 2019 (45)/Antiriciclaggio 2019 - Sconosciuto.pdf
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Traceback (most recent call last):
  File "runpy.py", line 196, in _run_module_as_main
  File "runpy.py", line 86, in _run_code
  File "site.py", line 39, in <module>
  File "site.py", line 35, in main
  File "calibre/utils/ipc/worker.py", line 196, in main
  File "<string>", line 1, in <module>
  File "calibre/srv/render_book.py", line 823, in viewer_main
  File "calibre/srv/render_book.py", line 814, in render_for_viewer
  File "calibre/srv/render_book.py", line 791, in render
  File "calibre/ebooks/oeb/iterator/book.py", line 62, in extract_book
  File "calibre/customize/conversion.py", line 242, in __call__
  File "calibre/ebooks/conversion/plugins/pdf_input.py", line 51, in convert
  File "calibre/ebooks/pdf/pdftohtml.py", line 83, in pdftohtml
calibre.ebooks.ConversionError: pdftohtml failed with return code: 1
Syntax Error: Couldn't find the 'EBX_HANDLER' security handler
@ElleKayEm
Copy link

ElleKayEm commented Aug 4, 2022

There is a bug which causes a problem when there is something wrong with the currently saved key. Try going into DeDRM's customization and deleting the Adobe Digital Editions key. Then restart calibre and re-add the book to see if DeDRM can automatically retrieve the correct key.

@aleguizzo
Copy link
Author

Thank you. Removing the key and re-importing the book made DeDRM work and the book was decrypted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants