Fix error reporting for DRMed PDF files.

This commit is contained in:
Kovid Goyal 2008-05-11 15:29:32 -07:00
parent eb5d4a24b9
commit 6836e867de
2 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,7 @@ def generate_html(pathtopdf, logger):
if ret != 0:
err = p.stderr.read()
raise ConversionError, err
if os.stat(index).st_size < 100:
if not os.path.exists(index) or os.stat(index).st_size < 100:
raise ConversionError(os.path.basename(pathtopdf) + ' does not allow copying of text.')
finally:
os.chdir(cwd)

View File

@ -23,9 +23,10 @@ What are the best formats to convert to LRF?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order of decreasing preference: LIT, MOBI, HTML, PRC, RTF, TXT, PDF
Why does the PDF conversion lose some images?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The PDF conversion tries to extract the text and images from the PDF file and convert them to and HTML based ebook. Some PDF files have images in a format that cannot be extracted (vector images).
Why does the PDF conversion lose some images/tables?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The PDF conversion tries to extract the text and images from the PDF file and convert them to and HTML based ebook. Some PDF files have images in a format that cannot be extracted (vector images). All tables
are also represented as vector diagrams, thus they cannot be extracted.
There are no images in the LRF file after conversion from HTML, or, why is only one HTML file being converted and not the others it links to?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~