html2pdf special characters not rendered
Asked Answered
D

0

7

I am using html2pdf library for genarating pdf with bookmarked index. By default it seems to work well for English content but i need to generate content that includes English & Arabic text. The "aefurat" font seems to work relatively good, except some special characters (’, ‘, “, ”, ...) that are rendered as boxes ([]).

The code I used is,

require_once(dirname(__FILE__).'/../html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8', 0);
$html2pdf->setDefaultFont('aefurat');      
$html2pdf->writeHTML($content);
$html2pdf->Output('bookmark.pdf');

A Sample content that includes arabic and special chararacters is,

’This is Arabic’ "العربية" Example With TCPDF... some text here some text here some “text here”.

Wondering if I need to use some other font or alter some configurations. Kindly advice me.

Dipole answered 4/4, 2013 at 16:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.