From 14819b4ec7164a37440e7164e45dceb4b0044b80 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 2 Dec 2019 20:32:02 +0530 Subject: [PATCH] PDF Output: Fix the option to break long words at the end of lines not working since calibre 4. Fixes #1854349 [pdf-hyphenate no longer hyphenating pdfs](https://bugs.launchpad.net/calibre/+bug/1854349) [pdf-hyphenate no longer hyphenating pdfs](https://bugs.launchpad.net/calibre/+bug/1854349) --- src/calibre/ebooks/pdf/html_writer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/pdf/html_writer.py b/src/calibre/ebooks/pdf/html_writer.py index 02770176f6..4f5825a865 100644 --- a/src/calibre/ebooks/pdf/html_writer.py +++ b/src/calibre/ebooks/pdf/html_writer.py @@ -1143,6 +1143,9 @@ def add_maths_script(container): def convert(opf_path, opts, metadata=None, output_path=None, log=default_log, cover_data=None, report_progress=lambda x, y: None): container = Container(opf_path, log) report_progress(0.05, _('Parsed all content for markup transformation')) + if opts.pdf_hyphenate: + from calibre.ebooks.oeb.polish.hyphenation import add_soft_hyphens + add_soft_hyphens(container) has_maths = add_maths_script(container) fix_fullscreen_images(container)