...

View Full Version : Fpdf



the moose
08-25-2009, 10:28 AM
I am creating a PDF file from HTML, but it is not retaining the formatting of things like the font etc.

Any ideas why:
$pdf=new PDF();

$pdf->SetMargins($left_margin, $top_margin);
$pdf->pgwidth = 210-($left_margin+$right_margin);
$pdf->SetAutoPageBreak (true, $bottom_margin);
$pdf->AddPage();
$pdf->WriteHTML($buffer);
$pdf->Output(getcwd()."/".$name);

This is the only problem I am having. Everything else is working well.

Thanks for your help guys.

Cheers

The Moose

tailender1
08-26-2009, 06:42 AM
I am creating a PDF file from HTML, but it is not retaining the formatting of things like the font etc.

Any ideas why:
$pdf=new PDF();

$pdf->SetMargins($left_margin, $top_margin);
$pdf->pgwidth = 210-($left_margin+$right_margin);
$pdf->SetAutoPageBreak (true, $bottom_margin);
$pdf->AddPage();
$pdf->WriteHTML($buffer);
$pdf->Output(getcwd()."/".$name);

This is the only problem I am having. Everything else is working well.

Thanks for your help guys.

Cheers

The Moose
if you need to save to file you have to use F option like


$pdf->Output(getcwd()."/".$name,'F');
by the way make sure you file name ends with .pdf extension.

the moose
08-26-2009, 10:04 AM
Thanks for that!

Basically, the only issue I am having is the HTML formatting is NOT being carried across to the final PDF :o(

Any ideas why??

Cheers

The Moose



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum