I am using PDF functionality to export an html page but html page is in "Greek" and all characters are displayed as "?" in exported pdf. How can i change this behavior when using html?.
I solved my problem by adding this code to the 'jqgrid_dist.php' file.
$fontname = $pdf->addTTFfont('../../lib/inc/tcpdf/fonts/Roboto-Black.ttf', 'TrueTypeUnicode', '', 32);
$pdf->SetFont($fontname, '', 11, '', false);
Is there any way to do it via standard configuration and not via the core code file? If not it will be great to be able to configure it more easily without modifying any source code!
You can also connect on_render_pdf event handler and set these params.
$e["on_render_pdf"] = array("set_pdf_format", null);
$g->set_events($e);
function set_pdf_format($arr)
{
$pdf = $arr["pdf"];
$data = $arr["data"];
// enable utf8 font
$pdf->SetFont('cid0jp', '', 11);
…
}
It seem that this code is not working when using "html" type for PDF.
The page gets 500 error.
function set_pdf_format($arr)
{
$pdf = $arr["pdf"];
$data = $arr["data"];
// enable utf8 font
$pdf->SetFont('cid0jp', '', 11);
//html code
$html = …..;
return $html;
}
I Have implemented the code from demos/export/export-pdf-html.php but i am unable to use the following code inside the set_pdf_format_x:
$pdf = $arr["pdf"];
$pdf->SetFont('cid0jp', '', 11);