I am creating pdf using tcpdf (php,mysql) library. I want to show data as it is in database, in the pdf. Means i want to show line breaks and line spacing.
Example : Say Project subtitle in database is like this.
The Philadelphia Foot Patrol Experiment, a randomized control trial
conducted by Temple University, has shown that foot patrols reduce
crime.
[1] With the resources to patrol 60 locations, researchers identified
the highest violent crime corners in the city, using data from 2006 to
2008. Police commanders designed 120 foot patrol areas around these
corners,
But it is outputting like this
The Philadelphia Foot Patrol Experiment, a randomized control trial
conducted by Temple University, has shown that foot patrols reduce
crime.[1] With the resources to patrol 60 locations, researchers
identified the highest violent crime corners in the city, using data
from 2006 to 2008. Police commanders designed 120 foot patrol areas
around these corners,
This is the view code in codeigniter, i have written to generate pdf
<?php
$tcpdf;
$obj_pdf = new TCPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$obj_pdf->SetCreator(PDF_CREATOR);
$obj_pdf->SetAuthor('Finvensys Technologies Pvt. Ltd.');
$obj_pdf->SetTitle('Proposal Writing');
$obj_pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, @$table->projectTitle);
$obj_pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN,'', 14));
$obj_pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '',9));
$obj_pdf->SetDefaultMonospacedFont('helvetica');
$obj_pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$obj_pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$obj_pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$obj_pdf->SetFont('helvetica', '', 12);
$obj_pdf->setFontSubsetting(false);
$obj_pdf->AddPage();
ob_start(); ?>
<table border="1px" align="left" style="width=100%">
<tr >
<td style="width:25%"><b>Project subtitle</b></td>
<td style="width:75%"><?php echo @$table->projectSubTitle; ?></td>
</tr>
</table>
<?php $title=@$table->projectTitle; ?>
<?php
$content = ob_get_contents();
ob_end_clean();
$obj_pdf->writeHTML($content, true, false, true, false, '');
$obj_pdf->Output($title.'.pdf', 'I');
?>