noDRM / DeDRM_tools

DeDRM tools for ebooks
7.12k stars 319 forks source link

Readium LCP on pdf - Doesn't work #367

Closed moroboshi84 closed 1 year ago

moroboshi84 commented 1 year ago

Question / bug report

If remains .lcpdf, Calibre open it with Thorium reader.

If I try to convert to epub, Calibre says:

NOTICE: Unable to convert some books: The book could not be converted because no supported format was found as input

publication - No supported format (available formats: lcpdf)

If I try to change its extension from .lcpdf to .pdf and gave me:

Unable to load PDF document. 

If I try to convert to epub, after changing its extensions in .pdf, Calibre says:

"calibre_plugins.dedrm.__init__", line 914, in PDFDecrypt

    pdf_encryption = ineptpdf.getPDFencryptionType(path_to_ebook)

                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/maprea/.config/calibre/plugins/DeDRM.zip/ineptpdf.py", line 2301, in getPDFencryptionType

    parser = PDFParser(doc, inf)

             ^^^^^^^^^^^^^^^^^^^

  File "/home/maprea/.config/calibre/plugins/DeDRM.zip/ineptpdf.py", line 1871, in __init__

    self.doc.set_parser(self)

  File "/home/maprea/.config/calibre/plugins/DeDRM.zip/ineptpdf.py", line 1201, in set_parser

    self.xrefs = parser.read_xref()

                 ^^^^^^^^^^^^^^^^^^

  File "/home/maprea/.config/calibre/plugins/DeDRM.zip/ineptpdf.py", line 1997, in read_xref

    pos = self.find_xref()

          ^^^^^^^^^^^^^^^^

  File "/home/maprea/.config/calibre/plugins/DeDRM.zip/ineptpdf.py", line 1954, in find_xref

    raise PDFNoValidXRef('Unexpected EOF')

ineptpdf.PDFNoValidXRef: Unexpected EOF

InputFormatPlugin: Input PDF running

on /tmp/calibre_6.22.0_tmp_30cd3kwf/acl12be5.pdf

Converting the file to html...

Traceback (last call):

  File "/usr/bin/calibre-parallel", line 21, in <module>.

    sys.exit(main())

             ^^^^^^

  File "/usr/lib/calibre/utils/ipc/worker.py", line 215, in main

    result = func(*args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^

  File '/usr/lib/calibre/gui2/convert/gui_conversion.py', line 38, in gui_convert_override

    gui_convert(input, output, recommendations, notification=notification,

  File '/usr/lib/calibre/gui2/convert/gui_conversion.py', line 25, in gui_convert

    plumber.run()

  File "/usr/lib/calibre/ebooks/conversion/plumber.py", line 1108, in run

    self.oeb = self.input_plugin(stream, self.opts,

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/calibre/customize/conversion.py", line 242, in __call__

    ret = self.convert(stream, options, file_ext,

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File '/usr/lib/calibre/ebooks/conversion/plugins/pdf_input.py', line 51, in convert

    pdftohtml(os.getcwd(), stream.name, options.no_images)

  File "/usr/lib/calibre/ebooks/pdf/pdftohtml.py", line 83, in pdftohtml

    raise ConversionError('pdftohtml failed with return code: %d\n%s' % (ret, out))

calibre.ebooks.ConversionError: pdftohtml failed with return code: 1

Syntax warning: may not be a PDF file (continue anyway)

Syntax error: Unable to find trailer dictionary

Syntax error: Cannot find trailer dictionary

Syntax error: Cannot read xref table"

If is usable cat output:

license.lcpl�Uٮ��}�WD���▒�Hy��3▒0x���Z�m<����l��N��DQt-�]��V-�bY�M�L��Y�-����7  �4N;w��eWUٺ
                                                                                                                                                                                           ��p����q���Q��m�>|�q'V�v��:�}Ù7�t`����'@X��TwiU.޾�8Fi~6����▒��▒�Xak&�Uمe�9
���s���3�ۅc�9I�f�P����ꛟk�m��q�b`��~��\��%;b|▒�;O�7q� fb�99*g�HD�̋���'��*��d6?�B�K���#▒��@���(�!(��E����-��V���`��n޿���x�ف�m>Y�W�Io(�����;o2i�UN���:�y�h���D`O e6Ʊ.&ա��h�<���P�:�����+�
                                                                                   �b�6eܶ~ʾ0�
                                                                                            �������e�.���eф�k��O��      �?y-    ����M�K��0H�9��{��s���k��q,����7��e�?
k��u���ˀȳ
���▒nyo�Kp�{�{�_�BB�+?�[���-ܹ*ݡ]�U��8�o�
F�B�N��
E��yUnӸ��4᫸6]▒�ؽ������$V�b䆆�yY�I��k?V��&�k[�����t����W��q�
                        ����C�9���rP*���*{���n0���#?�T��03�▒;�<�����V��;��QS/���35���\�j[r��� %�Q���Q�U�g��������ư�nl�;{Q/��k�u��P玤��N�J�^�A��q�G��XB���N�G�ر�ks�<���N�ԎhN��_U�3x0��#▒�g  �3sU�W���*ɀ��kϲ�)�hl�>�T7�ϰ(�Y��8��\�+%�&�ٚ��jTK���͹t[������L�?"kg��
                                                                  ��]���Xz�<(��Npճ��;�vJ����z�T�uU1�3?Rz@ۭ/x�ș�w���      �%L���޲▒5WG�p�▒]O���q�t�r��v�����la����Kj������{#����I{ǞX��/otx�▒���<�w�=�*����P�c�
  ▒�%�P^��.*U*����P9cP)0V��x�4�u���_
                                    �c]&O�Cy�=ќK�᷁~▒��r�a���Cq�<�8{$Y*2��8������:��m ▒QE���JJ����d�
                                                                                                  ;�������.;"�Ea�� z$����,���▒�&Ps\�?7.�,��,���&�����,@I�H���S�G���V��ʖ����=�P�b�=q8�{����}����y4�|ę����O䶯�h�,O����ݳ�%�V��VW8׺�;U)�w��l&���        ���{��
P�J���e&�eK                                                   �&�iðuQ�U��)��.,Wc���8�o���|��fT�84�|k�p�OciJ,��&y�=J��1~�(�߯``h����tN�
           l���A
manifest.json��MN�0F�c�&qR�&�ֹ@�4��j���&���uW�n��_۞�V*�  ��
��z��p�Ib�����*�ݱi�
"{�r�Ӹ0��          �����7
         ��V�▒��x������"��}�8W`���ġ߀i�2��ज�T�V�#Bo�+��e�� 1�����/2�����>8��ƲWO(�#�MI���.;�ݑ����$���a;PwM�q�'��'��k�>���m��bt���1�_jH)���'P�9�O��۞�Vc�j�
                                                                                                                                                      ZZ��publication.pdfP۞�V(ǻ�m�
                                                                                                                                                                                        ��E
                                                                                                                                                                                           Z���Zmanifest.jsonPK�Z%

Which version of Calibre are you running?

6.22

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

Paste log output here.
ElleKayEm commented 1 year ago

Readium LCP is no longer supported due to a takedown request. See this issue: https://github.com/noDRM/DeDRM_tools/issues/18

moroboshi84 commented 1 year ago

Ok, for me you can close this. If Is usable I can share the script I wrote to solve It (works outsider calibre platform), less complex and less flexible of yours, of course... Documentation of Readium It's really poor.

ElleKayEm commented 1 year ago

You can close the issue.