Output – Finalise the document and send it to specified destination
Note: As of mPDF v8.1.2 it is preferred to use verbose aliasesOutputBinaryData,OutputHttpInline,OutputHttpDownload, andOutputFile
string|voidOutput ([ string$filename[, string$dest ])
Send the document to a given destination: browser, file or string. In the case of browser, the plug-in may be used(if present) or a download (“Save as” dialog box) may be forced.
The name of the file. If not specified, the document will be sent to the browser (destination\Mpdf\Output\Destination::INLINE).
BLANK or omitted:'doc.pdf'
Destination where to send the document. Use class constants from\Mpdf\Output\Destination for better readabilityand understandability
Default:\Mpdf\Output\Destination::INLINE
\Mpdf\Output\Destination::INLINE, or"I"header PHP function.\Mpdf\Output\Destination::DOWNLOAD, or"D"header PHP function.\Mpdf\Output\Destination::FILE, or"F"\Mpdf\Output\Destination::STRING_RETURN, or"S"Note: You can use the\Mpdf\Output\Destination::STRING_RETURN option to e-mail a PDF file - see example under E-mail a PDF file.
Warning: mPDF is not meant to receive HMTL/CSS from an outside user.
All user input passed to mPDF should be vetted and sanitized properlyabove the levelof standard browser-level sanitization (such ishtmlspecialchars).
<?php// Sends output inline to browser$mpdf=new\Mpdf\Mpdf();$mpdf->WriteHTML('Hello World');$mpdf->Output();<?php$mpdf=new\Mpdf\Mpdf();$mpdf->WriteHTML('Hello World');// Saves file on the server as 'filename.pdf'$mpdf->Output('filename.pdf',\Mpdf\Output\Destination::FILE);