From 6836e867de184830d0c11bc43daf4a4f79c85241 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 May 2008 15:29:32 -0700 Subject: [PATCH] Fix error reporting for DRMed PDF files. --- src/calibre/ebooks/lrf/pdf/convert_from.py | 2 +- src/calibre/manual/faq.rst | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/lrf/pdf/convert_from.py b/src/calibre/ebooks/lrf/pdf/convert_from.py index 0b11d47877..0fcbb8eb34 100644 --- a/src/calibre/ebooks/lrf/pdf/convert_from.py +++ b/src/calibre/ebooks/lrf/pdf/convert_from.py @@ -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) diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 0f7a6ca3b9..ea90a8a1bd 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -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? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~