mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-23 22:53:12 +02:00
A more helpful error message when trying to convert a DRMed PDF file.
This commit is contained in:
parent
6f7a0c8bb7
commit
4f043f3323
1 changed files with 3 additions and 1 deletions
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
PDFTOHTML = 'pdftohtml'
|
||||
if isosx and hasattr(sys, 'frameworks_dir'):
|
||||
PDFTOHTML = os.path.join(sys.frameworks_dir, PDFTOHTML)
|
||||
PDFTOHTML = os.path.join(getattr(sys, 'frameworks_dir'), PDFTOHTML)
|
||||
|
||||
|
||||
def generate_html(pathtopdf, logger):
|
||||
|
|
@ -47,6 +47,8 @@ def generate_html(pathtopdf, logger):
|
|||
if ret != 0:
|
||||
err = p.stderr.read()
|
||||
raise ConversionError, err
|
||||
if os.stat(pf.name).st_size < 100:
|
||||
raise ConversionError(os.path.basename(pathtopdf) + ' does not allow copying of text.')
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
return pf
|
||||
|
|
|
|||
Loading…
Reference in a new issue