V
V
Vladimir Romantsov2017-04-24 00:52:30
PHP
Vladimir Romantsov, 2017-04-24 00:52:30

Why doesn't TCPDF output a table from a variable with HTML?

For PDF generation I use TCPDF class. I ran into a problem, I display a table from a variable in which I collect data through foreach, but the table is not displayed in pdf. Further, I output the data with the variable (the generated HTML table) to the browser via echo, ctrl + u copy what the server directly gave. I add HTML to the $tbl variable as a string. I substitute this variable for the previous one. And Everything works... Just in the TCPDF examples All HTML that was output via the writeHTML method was previously described in a string variable. Maybe there are some nuances?
I tried converting to UTF-8 before output, but it didn't work.

$tbl=utf8_encode($tbl);
$pdf->writeHTML( $tbl , true, false, false, false, '');

Maybe someone has ideas in which direction to dig? Or has anyone experienced a similar situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question