Print HTML cell data text in pdf (using TCPDF)

[B]Hello,

I have a table where I have a column with the name “summary” in which I have n cells. In the first cell I have this data (in the next I have somthing similar etc):[/B]
----------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p><em><strong>first text</strong>, second text <strong>third text</strong>.</em></p>
<ul>
<li><em><strong>text</strong>|<strong> text</strong> (<strong>text</strong>text, <strong>text</strong>);<br /></em></li>
<li><em>text;<br /></em></li>
<li><em><strong>text, text</strong>, text.</em></li>
</ul>
</body>
</html>
----------------------------------------------------------

I want to print this text in pdf in order to have the following format: first text, second text third text.

  • [I][B]text[/B]|[B] text[/B] ([B]text[/B]text, [B]text[/B]);[/I]
  • [I]text;[/I]
  • [I][B]text, text[/B], text. [/I]
[B]I created a pdf report and in there I inserted the following code:[/B]

---------------------------------------------------------
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.’ 006’, PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, ‘’, PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, ‘’, PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional)
if (@file_exists(dirname(FILE).’/lang/eng.php’)) {
require_once(dirname(FILE).’/lang/eng.php’);
$pdf->setLanguageArray($l);
}

// set font
//$pdf->SetFont(?tahoma?, 12, ?, ?false?);

$cell_summary = {summary};
$html = '<table border = “0” cellspacing=“1” cellpadding=“1”>

<tr>
<td>’.$cell_summary .’ </td>
</tr>
</table>’;

// output the HTML content
$pdf->writeHTML($html, true, false, true, false, ‘’);

// reset pointer to the last page
$pdf->lastPage();


[B]The result is a blank page…doesn’t appear anything…any ideas where I went wrong?

Thank you for your time,
Dan[/B]

Is there anything in the PHP logs? Is scriptcase running under the default installer web environment?

Hey,

  • Scriptcase is running under the default installer web environment;
  • I have activated debugger mod and I don’t have any error in there ( it appears only the selection that I have made)

Where should I look for the php logs?

Thank you for your support,
Dan

I don’t really remember where it is located at on a Windows installation, but for linux users the path is (assuming your signature is up to date and you’re using version 8 of ScriptCase) /opt/NetMake/v8/components/apache/logs/error_log

Ok, I founded the error log…but there is nothing helpful in there … I attached them. (before I deleted the initial one and then I generate the source code for my 1234.pdfl file in order to have in this files fewer lines).

any idea what can I do?

[I]--------------------------------------------
//$cell_summary = {summary}; //<= line 1
$html = '<table border = “0” cellspacing=“1” cellpadding=“1”>

<tr>
//<td>’.$cell_summary .’ </td> //<= line 2
</tr>[/I]
</table>’;
-------------------------

If I comment line marked with 1 & 2 then everything I’ll put on the table will work just fine.

Thank you,
Dan

logs.zip (1.75 KB)