save a PDF file to a directory using mPDF

umasachin picture umasachin · Aug 21, 2012 · Viewed 23.3k times · Source

I have a question regarding the PDF files.I have written the code in order to open a PDF, i manage to output the context in the browser but i want also this PDF file to be saved in a directory.

Does anyone know how i will do it?

I can post the code if you think this will be helpful for you.

Thank you in advance, Sachin

Answer

Djave picture Djave · Feb 27, 2013

Quote from stackoverflow:

Docs state that the first argument of Output() is the file path, second is the savng mode - you need to set it to 'F'.

$mpdf->Output('filename.pdf','F');