David Fernández
David Fernández

Reputation: 544

TCPDF library in JOOMLA! component outputs html in PDF

I have a component in joomla that exports to PDF, the problem that i'm encountering is that the PDF exported is unreadable because the html of the Joomla! page in inserted after and before the pdf itself.

I have made a standard structure of a component and call it like

index.php?option=com_listado_factura&task=exportar_pdf

being com_listado_factura the name of the component and exportar_factura the function of the controller that exports to pdf.

I've looked everywhere and couldn't find the solution, thanks

Upvotes: 2

Views: 2464

Answers (1)

David Fernández
David Fernández

Reputation: 544

The solution was to call:

ob_end_clean();

before

$tcpdf->output();

Upvotes: 5

Related Questions