-1

Hi i am trying create a helper to convert a entire html from a CTP to PDF using tcpdf->writeHTML();

I have tried:

function beforeLayout(){

    ob_clean();

    ob_start();

    $pageOrientation = 'P';

    $this->setup($pageOrientation);
    $this->pdf->AddPage(); 

    $this->pdf->setPrintHeader(false);
    $this->pdf->setPrintFooter(false);

    $this->pdf->SetFont('times','B',8);

    $this->pdf->writeHTML(ob_get_contents(), false, false, false, false, 'L');

    echo $this->pdf->Output('x.pdf', 'D'); 

}

But without sucess :(

celsowm
  • 846
  • 9
  • 34
  • 59
  • You have to be more precise than that... Does it open a blank pdf? Does it not give you a download prompt? Try some test instead of ob_get_contents(), and see if that works – Ben Jul 07 '11 at 23:05

1 Answers1

0

What exactly is in your output buffer? I see it starting at the beginning of the function, and don't see any output after it? Is just nothing happening? Any errors thrown?

Did you Try:

$this->pdf->writeHTML(ob_get_contents(), false, false, false, false, 'L');

Only these tags are supported:

IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. Supported tags are:

a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul

Ben
  • 745
  • 7
  • 23