pdf-hyphenate no longer hyphenating pdfs

Bug #1854349 reported by jimbojw on 2019-11-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

calibre version 4.4 (git 163b2dfd2d via CALIBRE_DEVELOP_FROM)
OS: ubuntu

The --pdf-hyphenate option seems to no longer hyphenate long words when generating PDFs from HTML/epub input.


  ebook-convert wealth-excerpt.html wealth-excerpt.pdf --pdf-default-font-size=48

jimbojw (jimbojw) wrote :
jimbojw (jimbojw) wrote :
jimbojw (jimbojw) wrote :

Sorry, command:

  ebook-convert wealth-excerpt.html wealth-excerpt.pdf --pdf-default-font-size=48 --pdf-hyphenate

Yes, this is a limitation of WebEngine, it has no support for
hyphenation. I suggest using the calibre hyphenation plugin to
pre-hyphenate the book before conversion. At some point I might use
hyphenate.js to hack in hyphenation, but until then, this is a wontfix.

 status wontfix

Changed in calibre:
status: New → Won't Fix
jimbojw (jimbojw) wrote :

If --pdf-hyphenate doesn't hyphenate PDFs, then it would help users to find a comment to this effect in the documentation: https://manual.calibre-ebook.com/generated/en/ebook-convert.html#cmdoption-ebook-convert-pdf-output-pdf-hyphenate

jimbojw (jimbojw) wrote :

Is it possible to use plugins with ebook-convert, or only through the calibre GUI?

Kovid Goyal (kovid) wrote :

Depends on the plugin, some implement command line interfaces, some do

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Won't Fix → Fix Released
jimbojw (jimbojw) wrote :

Using CALIBRE_DEVELOP_FROM, I updated to git HEAD and tried to run this, but I'm getting a Python error that ends with this line:

IOError: [Errno 2] No such file or directory: u'/home/jimbo/checkout/calibre/resources/hyphenation/locales.json'

Looking on github, there does not appear to be a 'hyphenation' directory under the 'resources' dir at all: https://github.com/kovidgoyal/calibre/tree/master/resources

Are there special steps necessary to acquire the locales.json file?

jimbojw (jimbojw) wrote :

Update: I installed v. 4.5 just now, and that works without CALIBRE_DEVELOP_FROM, so the hyphenate/locales.json must be included in the build process.

jimbojw (jimbojw) wrote :

Sorry, by 'works' I mean that it's able to run to completion without error, but I'm not seeing any hyphenated words when converting the HTML I attached above.

You need to wait for the next reease or build calibre from source.
CALIBRE_DEVELOP_FROM will not work for this, since it requires native
code changes.

The feature was implemented in git master, after the 4.5 release, and it
requires a shared library, a new C module extension in calibre's
codebase, various python changes, and new content in the resources/
directory which is not checked into git (because it vendors a collection
of hyphenation dictionaries and creates a json file describing them).

You cannot obtain the feature using CALIBRE_DEVELOP_FROM, because that
method only works to obtain python-only updates.

Instructions for building from source are in

But you are on your own in carrying this out -- I'm not sure how to do
any of that on debian-based distributions. You'll probably have to
install various header packages, for example.

Users of the Arch Linux distribution could use my calibre-git build
recipe to trivially build calibre from source, using the latest git version.

Or you could wait for 4.6.0 to be released with the required binary changes.

jimbojw (jimbojw) wrote :

Thanks for clarifying. I will wait for the 4.6 release to use this feature. 👍

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers