PHP 7 MPDF Example to Automatically Download PDF Document as Attachment Using output() Method in Browser Full Project For Beginners

  • Post author:
  • Post category:PHP
  • Post comments:0 Comments

 

 

index.php

 

 

include("../mpdf.php");
$html="my HTML code here !";

$mpdf=new mPDF('c','A4','','',32,25,27,25,16,13); 
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; 
$stylesheet = file_get_contents('mpdfstyletables.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($html);
$mpdf->Output('mpdf.pdf','D');

Leave a Reply