Restore handling of page-break CSS properties for PDF Output

The restriction caused by QWebSettings.LocalContentCanAccessFileUrls
was preventing it from working.
This commit is contained in:
Kovid Goyal 2016-12-24 13:09:38 +05:30
parent 3cdc7a8096
commit fb60925df3

View File

@ -123,9 +123,13 @@ class PDFOutput(OutputFormatPlugin):
def convert(self, oeb_book, output_path, input_plugin, opts, log):
from calibre.gui2 import must_use_qt, load_builtin_fonts
from calibre.ebooks.oeb.transforms.split import Split
# Turn off hinting in WebKit (requires a patched build of QtWebKit)
os.environ['CALIBRE_WEBKIT_NO_HINTING'] = '1'
try:
# split on page breaks, as the JS code to convert page breaks to
# column breaks will not work because of QWebSettings.LocalContentCanAccessFileUrls
Split()(oeb_book, opts)
must_use_qt()
load_builtin_fonts()