Algie Rosario
Algie Rosario

Reputation: 1

Can't Open my Downloaded PDF

I have a Code Below in which it Successfully downloading a .pdf file but when i open the file it always shows an error message. This is my Code: include("MPDF57/mpdf.php");

$mpdf=new mPDF('c','A4','','',32,25,27,25,16,13); 
$mpdf->SetDisplayMode('fullpage');
$mpdf->showImageErrors = true;

$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list    

$html='<html><head></head><body>Test</body></html>'; //Assign HTML HERE    

$mpdf->WriteHTML($html); 
$mpdf->Output('Certificate.pdf','D');      

Please do help guys, Thanks in Advance.

Upvotes: 0

Views: 1054

Answers (2)

Manu R S
Manu R S

Reputation: 970

Try this one..will help you..

http://stackoverflow.com/questions/9248510/working-with-pdf-in-php

Upvotes: 0

Anitha Mani
Anitha Mani

Reputation: 867

use header("Content-type:application/pdf");

Upvotes: 1

Related Questions