Welcome Guest, Not a member yet? Register   Sign In
Write PDF

Hi.I'm using Mpdf library and I want to save pdf, witch I've generated, into my hard disc. But path is incorrect. I can only save file on the server. Is there possibillity to choose destination of saves files?
This is my code:
function index()

      $this->mpdf->WriteHTML('Hallo World');
      write_file('./file.pdf', $file)


You have to send the PDF to the client (download). I don't know mpdf, but it looks like the second parameter triggers that, look up the it's documentation

[eluser]Tudip Technologies[/eluser]
If you do not specify the path in that output method call, it would ask user to save it.
I don't think you can force download at specific location on client machine anyway.
We have been using mpdf 5.+ version and it works pretty much out of the box with CI.

In case you have problem with the mpdf+CI, here is a small blog entry.


Theme © iAndrew 2016 - Forum software by © MyBB