Closed erfanhemmati closed 4 years ago
im working with laravel 5.7 & barryvdh/laravel-dompdf 0.8.4 fixed arabic letters as below:-
1- download the ar-php library for khaled.alshamaa from the following link http://www.ar-php.org/ (its free arabic Library with LGPL license)
2 - extract and upload I18N folder inside dompdf folder
3- open Glyphs.php file in this path
vendor\dompdf\I18N\Arabic
search
public function utf8Glyphs($str, $max_chars = 50
replace to
public function utf8Glyphs($str, $max_chars = 150
4-in text_renderer.cls.php file vendor/dompdf/dompdf/src/Render/Text.php
before class name class Text extends AbstractRenderer add this
include DOMPDF_DIR . "/I18N/Arabic/Glyphs.php"; use I18N_Arabic_Glyphs;
before this line
$this->_canvas->text($x, $y, $text
add this code
if ( ! class_exists( 'I18N_Arabic' ) ){ $Arabic = new I18N_Arabic_Glyphs('Glyphs'); $text = $Arabic->utf8Glyphs($text);
}
in ur pdf file add this style
body{
font-family: DejaVu Sans, sans-serif;
}
include(C:\laragon\www\tamaiuz\vendor\dompdf\dompdf/I18N/Arabic/Glyphs.php): failed to open stream: No such file or directory
this error appeared after i follow the instructions
use below package: https://github.com/mccarlosen/laravel-mpdf
i tested and works with persian well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Most issues are actually related to DompDF (eg rendering the PDF itself), so please raise an issue there: https://github.com/dompdf/dompdf If you believe this is still an actual issue with this library, please reply to this issue.
use below package: https://github.com/mccarlosen/laravel-mpdf
i tested and works with persian well.
@hannanstd when I use this all the pages come blank
juste use
easy and perfect solution, without domPdfjuste use
easy and perfect solution, without domPdf
hi friends this package dose not support persian or arabic language for why ?!