dokuwiki-plugin-dw2pdf icon indicating copy to clipboard operation
dokuwiki-plugin-dw2pdf copied to clipboard

RTL support

Open srabi opened this issue 3 years ago • 2 comments

The only way I could get the PDF to be aligned properly to the right (for hebrew) was to add the following line in action.php:

$mpdf->SetDirectionality('rtl');

I added it right after the setTitle line (408) and obviously it's not a solution, just a patch... However, anything else I've tried didn't work.

Am I missing something fundamental about how to get RTL to work?

srabi avatar Feb 06 '22 08:02 srabi

Good proposal. The default setting in mpdf is ltr, so it makes sense to set this explicitly, and would also not change anything for the ltr languages. Direction can be retrieved from the $lang['direction'] global.

Pull request is welcome.

Klap-in avatar Feb 06 '22 11:02 Klap-in

Could e.g. the translation plugin provide per page directions? In that case it is logic to set the direction in action.php, otherwise is per export preferred so in DokuPDF.class.php. (There are already other language settings as well) ( there the global can be used, that is the direction of the language that is set globally in the wiki, or with some translation plugins overwritten for the page you are currently looking. But the dw2pdf plugin is also used in bookcreator, which can export more wiki pages, so these could theoretically have different languages...)

Klap-in avatar Feb 06 '22 11:02 Klap-in

We assume already that the global language setting of the wiki can be used. Therefore just implemented, I expect it works fine with Bookcreator plugin for that reason, but otherwise I hope people will report it.

Klap-in avatar Oct 08 '22 18:10 Klap-in