filament-export icon indicating copy to clipboard operation
filament-export copied to clipboard

little fix to support arabic in pdf.

Open Saifallak opened this issue 1 year ago • 2 comments

Overview

Me and #34 and many others in the community using the Arabic language need to use PDF export.

Proposal

using the library https://github.com/khaled-alshamaa/ar-php we can modify the outputted HTML to support our language.

how? if ArPHP is installed on the system it will use it, by: class_exists('ArPHP\I18N\Arabic')

why it's not required in composer? I didn't require it in Composer because i don't think everybody needs Arabic support.

BTW: if you think this should be installed on every project just require it also, I think it would be great if we can mention it in the readme, but not sure.

Linked Issues & PRs

this helps #75 and follows #76 to support more locales (eg. Arabic) and for sure fixes #34

Saifallak avatar Jun 13 '23 13:06 Saifallak

hey! thanks for your contribution. but I am not sure we should implement something this specific. have you tried modifying the pdf writer using ->modifyPdfWriter() option (see here)? it should be enough, I guess. check laravel-dompdf to see what is possible.

alperenersoy avatar Jun 20 '23 17:06 alperenersoy

nope, there is nothing to do with the writer itself, it needs to modify the html before pdf writer comes in. and this is the only way,

and it's not affecting anybody not using Arabic, as it won't go in "if" cond.

Saifallak avatar Jun 20 '23 19:06 Saifallak