1
I am using the library in fpdp cakephp, created a private method in my controller by mounting a basic pdf and then called this method in an action but it does not generate pdf..
private method:
private function montaPDF(){
require('fdpf/fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
}
and returns this error on my page:
%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream x 3R 2 35W(�r Q�w3T04�30PISp �Z*�[����(hx����+���(j*�d��7W endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 2 0 obj << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font << /F1 5 0 R >> /XObject << >> >> endobj 6 0 obj << /Producer (FPDF 1.7) /CreationDate (D:20150824102520) >> endobj 7 0 obj << /Type /Catalog /Pages 1 0 R >> endobj xref 0 8 00000000000000 65535 f 0000000228 00000 n 0000000416 00000 n 0000000009 00000 n 0000000087 00000 n 0000000315 00000 n 0000000520 00000 n 0000000595 00000 n trailer << /Size 8 /Root 7 0 R /Info 6 0 R >> startxref 644%EOF
Have you checked if it is not rendering the view? try
$this->autoRender = false
– Jeferson Assis
yes, it is with autoRender = false;
– Michel Henriq