Goal: make PDFs generated by Tiki via mPDF look nicer, by adding support for Widows and Orphans, and if possible Bottom Balancing, as explained at: https://guide.pressbooks.com/chapter/widows-orphans-and-bottom-balancing/
Tiki uses the Widows and Orphans CSS properties, but mPDF doesn't yet support them. So once support is added in mPDF 7.x, there should be a such pref in Tiki, defaulted to on, and overrideable per page via PluginPDF
Since the mPDF project doesn't (yet) have a wiki, we'll coordinate here.
- no license but some PHP code: https://www.pdflib.com/pdflib-cookbook/text-output/widows-and-orphans/php-widows-and-orphans/
- Prince is a proprietary solution that Pressbooks uses instead of mPDF: https://www.princexml.com/doc/paged/#widows-and-orphans
- wkhtmltopdf added support: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2457
- WeasyPrint added support: https://github.com/Kozea/WeasyPrint/commit/1d6c94828e3a9bc79dc0a9d4e2377619f0de78ac
- This thread indicates that LibreOffice and Word support Widows and Orphans by default https://bugs.documentfoundation.org/show_bug.cgi?id=89714#c9
- Wikipublisher: widow and orphan control and headings always kept with their following paragraphs
- Jonny added non-breaking space between last two words of headers in wiki pages: https://sourceforge.net/p/tikiwiki/code/HEAD/tree/trunk/lib/parser/parserlib.php#l3034
Needs to be added. page-break avoid after doesn't seem to be respected.
Perhaps try slightly adjusting spacing between letters?
- Scope the project
- Present plan to Matěj (lead dev of mPDF)
- Once approved, get to work!