Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

little fix to support arabic in pdf. #83

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Saifallak
Copy link

@Saifallak Saifallak commented Jun 13, 2023

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

@alperenersoy
Copy link
Owner

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.

@Saifallak
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTL Language issue
2 participants