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

How to generated pdf automatically save in my server

asgupta wrote on 2014-07-18:
Dear,

How to generated pdf automatically save in my server specific location. How's this is possible.
reply me
support wrote on 2014-07-21:
Hello,

PHP
$fd = fopen('/output/directory/mydocument.pdf', 'wb');
$client->convertURI("http://example.com", $fd);
fclose($fd);


Python
with open('/output/directory/mydocument.pdf', 'wb') as fd:
    client.convertURI("http://example.com", fd)


Java
FileOutputStream fileStream = new FileOutputStream("/output/directory/mydocument.pdf");
client.convertURI("http://example.com/", fileStream);
fileStream.close();


Ruby
File.open('/output/directory/mydocument.pdf', 'wb') {
    |f| client.convertURI('http://example.com', f)
}


C#
using(FileStream  
    fileStream = new FileStream("/output/directory/mydocument.pdf", FileMode.Create))
{
    client.convertURI("http://example.com", fileStream);
}


Bash
$ curl -F username=$USERNAME \
       -F key=$APIKEY \
       -F src=http://example.com \
       http://pdfcrowd.com/api/pdf/convert/uri/ > /output/directory/mydocument.pdf
alexandrubuzoianu wrote on 2018-05-17:
Hello,
Please, if possible, support me in solving a problem. I have a classic asp file and I want the page to be automatically saved with the pdf extension on my server when I click on it.
Thank you very much
support wrote on 2018-05-17:
You can use Pdfcrowd REST API https://pdfcrowd.com/api/html-to-pdf-http/
and POST requests from ASP to our url https://api.pdfcrowd.com/convert/.

Sample of ASP POST:
https://stackoverflow.com/questions/5300906/how-to-send-and-handle-http-post-in-asp#answer-5302015