This is an archived forum post. The information may be outdated. Contact us if you have any questions.

How to save pdf file in local/severs

vadicse wrote on 2015-03-02:
Hi,

I m using HTML to PDF - PHP Api. i want to save the pdf file in to local server once its generated from pdf crowed using PHP, is it possible ? How?

Please reply.

Thanks
Vadivel N
support wrote on 2015-03-04:
Hello Vadivel,

Yes, it is possible:
$out_file = fopen("document.pdf", "wb");
$pdf = $client->convertURI("http://example.com", $out_file);
fclose($out_file);
mattisbmx wrote on 2015-12-03:
Hi, it's possible in python?
mattisbmx wrote on 2015-12-03:
out_file = open("template.pdf", "wb")
pdf = client.convertURI("www.web.com", out_file)
out_file.close()
support wrote on 2015-12-09:
Yes, your Python code should work.

Just one thing - the URL passed to convertURI must specify a protocol. So "www.web.com" should be "http://www.web.com".