5

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

umasachin
  • 51
  • 1
  • 1
  • 2

1 Answers1

12

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');
Community
  • 1
  • 1
Djave
  • 8,595
  • 8
  • 70
  • 124
  • 1
    This solution saves the .pdf file into the root of the application (ie in CodeIgniter, it will be saved in the root directory together with `application`, `system`) –  Mar 21 '13 at 07:55
  • 6
    Not at home to test, but could you use `$mpdf->Output('../../filename.pdf','F');` – Djave Mar 21 '13 at 09:44
  • you saved my whole day .. thanks – Amanjot Kaur Sep 12 '18 at 04:52