Welcome Guest, Not a member yet? Register   Sign In
Problem tcpdf Code Ignited with css
#1

[eluser]Unknown[/eluser]
I need help,
how to make pdf from html files on the fly to support css?,
i try tcpdf, but i found problem in css/style
my code like this

(<td style=\"border:#ff0000 solid 1px\">)
cant show/display border...
help me... with your solution to create pdf from html

thanx


&lt;?php

$this->load->plugin( 'tcpdf' );

$pdf = tcpdf();



// set document information

$pdf->SetCreator(PDF_CREATOR);

$pdf->SetAuthor("Nicola Asuni");

$pdf->SetTitle("TCPDF Example 002");

$pdf->SetSubject("TCPDF Tutorial");

$pdf->SetKeywords("TCPDF, PDF, example, test, guide");

// set default header data

$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, 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 margins

$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);



//set auto page breaks

$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);



//set image scale factor

$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);



//initialize document

$pdf->AliasNbPages();



// add a page

$pdf->AddPage();



// ---------------------------------------------------------



// set font

$pdf->SetFont("dejavusans", "BI", 20);



// print a line using Cell()

//$pdf->Cell(0,10,"Example 002",1,1,'C');

$html="<table>

<tr>

<td style=\"border:#ff0000 solid 1px\">

<table border=1>";

for($i=0;$i<30;$i++){

$html.=" <tr>

<td style=\"border:#ff0000 solid 1px\">

".$satu."

</td>

<td>

".$satu."

</td>

</tr>";

}

$html.=" <tr>

<td>

".$dua."

</td>

</tr>

</table>

</td>

</tr>

</table>";

$pdf->writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='');

// ---------------------------------------------------------



//Close and output PDF document

$pdf->Output("example_002.pdf", "I");



?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB