Join GitHub today
Hyphenation with soft-hyphens (­) does not work #1722
wkhtmltopdf no longer respects soft-hyphens so words are not broken at positions where a manual break is suggested. A sample document to test is here. This is a bit strange since this worked with earlier versions like 0.11.0rc2.
Tested with version 0.12.1-7fac78c on OS X (Carbon and Cocoa) and 0.12.1-c22928d on Windows 7 64 (MSVC 2013).
@ashkulz, great, after applying the changes you mentioned it works, many thanks!! There is only one caveat, the hyphen is too long (perhaps an
I digged a little deeper and just tried
In fact it works better than with version 0.11.0rc2 where the hyphen sometimes isn't rendered with
This is case for documentation in my opinion.
My use cases for wkhtmltopdf require hyphenation. That is of course by no means representative, but for me the lack of it would have prevented using the current build. The patch contains only small changes, so I'm confident that it doesn't break other things, but that's not backed by thorough tests.
I vote for including the patch.
added a commit
Oct 21, 2014
Can confirm that visible hyphenation is working in 0.12.2.1.
There is, however, one big difference to how hyphens are present in the PDF file. Copying or searching through a PDF with Acrobat becomes impossible (other PDF viewers like Foxit Reader might work).
This happens to text that has been prepared with elements but has no visibly hyphenation in the PDF file because it does not need to fold around the document's edge, for example "majority" in the middle of a line. The text "majority" cannot be found in the document and will have spaces instead of the soft hyphens when copied to a text document. The example would appear as "major ity".
This was not true for PDFs created with 0.11rc1, although this may not directly relate to the issue at hand.