Set Option UTF-8 not responding
parkho opened this issue · comments
Good day,
I have a web page which I need to create a PDF. I'm new to Snappy, so everything works well and the PDF gets generated but the posted values from DB is not showing correctly since the characters are in Persian, I appreciate any help.
Thanks
pdftest.php file:
<?php
require __DIR__ . '/snappy/vendor/autoload.php';
use Knp\Snappy\Pdf;
$billno = $_POST["billno"];
$custname = $_POST["custname"];
$balance = $_POST["balance"];
$address = $_POST["address"];
$phone = $_POST["phone"];
$merchname = $_POST["merchname"];
$merchqty = $_POST["merchqty"];
$merchdetails = $_POST["merchdetails"];
$snappy = new Pdf('C://"Program Files/"/wkhtmltopdf/bin/wkhtmltopdf.exe');
header('Content-Type: application/pdf');
$snappy->setOption('page-size', 'A5');
$snappy->setOption('no-background',false);
$snappy->setOption('margin-top', '1');
$snappy->setOption('margin-bottom', '0');
$snappy->setOption('margin-left', '0');
$snappy->setOption('margin-right', '0');
$snappy->setOption('encoding', 'UTF-8');
$snappy->setOption('post', array('billno' => $billno,
'custname' => $custname,
'balance' => $balance,
'address' => $address,
'phone' => $phone,
'merchname' => $merchname,
'merchqty' => $merchqty,
'merchdetails' => $merchdetails
));
echo $snappy->getOutput('http://www.bnfgallery.ir/pdf.php');
The output pdf file image:
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.