Recommend this page to a friend! |
All requests ![]() |
> | What is the best PHP pdf creation class? | > | Request new recommendation | > | ![]() |
> | ![]() |
by Adrian - 8 years ago (2017-03-25)
+5 | I need to create PDF documents. |
1. by Liji - 3 years ago (2021-11-06) Reply
Hi I am using this code but while converting to PDF the Language Spelling is not correct. Can anyone guide me how to fix this. (Language Tamil, Font used is Latha)
<?php header('Content-type: text/html; charset=UTF-8') ;//chrome require_once('tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setFontSubsetting(true); $pdf->SetFont('Latha', '', 12); $pdf->AddPage();
$utf8text = ' <html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body> <p>கரூர௠பதிவ௠மாவடà¯à®Ÿà®®à¯, கிரà¯à®·à¯à®£à®°à®¾à®¯à®ªà¯à®°à®®à¯ சாரà¯à®ªà®¤à®¿à®µà®•à®®à¯, வடà¯à®Ÿà®®à¯, போதà¯à®¤à¯à®°à®¾à®µà¯à®¤à¯à®¤à®©à¯à®ªà®Ÿà¯à®Ÿà®¿, மேலவெளà¯à®³à®¾à®³à®ªà¯à®ªà®Ÿà¯à®Ÿà®¿à®¯à®¿à®²à¯ நதà¯à®¤à®®à¯ சரà¯à®µà¯‡ எணà¯. பாதைகà¯à®•à¯ கிழகà¯à®•à¯, à®®à¯à®°à¯à®•à®©à¯ வகையறா நிலதà¯à®¤à®¿à®±à¯à®•à¯ ---தெறà¯à®•à¯, பிசà¯à®šà¯ˆ மனைகà¯à®•à¯ --- மேறà¯à®•à¯, சீடà¯à®Ÿà®¿à®¯à®®à¯à®®à®¾à®³à¯ நிலதà¯à®¤à®¿à®±à¯à®•à¯ இதனà¯à®®à®¤à¯à®¤à®¿à®¯à®¿à®²à¯ வடபà¯à®°à®®à¯ கிழமேல௠அடி 96 ½ , தெனà¯à®ªà¯à®°à®®à¯ கிழமேல௠அடி சமீ </body></html>'; $pdf->writeHTML($utf8text, true, 0, true, true); $pdf->Output('example_008.pdf', 'I');
?>
+1 |
you can also try this new library which uses chrome-cli as browser so no more problems with html,css problems , very simple interface give it a try |
+1 |
as you use the term create and not convert you can use this class but https://www.phpclasses.org/package/9615-PHP-Convert-HTML-to-PDF-using-pdflayer-API.html has more options like Dave smith told you... |
+4 |
There are a couple packages out there that are no longer being maintained that can generate PDF files, namely fpdf and tcpdf. This package will take a HTML document and convert it to pdf using an API service which supports html5 and css3. |
Recommend package | |
|