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

Generate PDF at Server Side

sbzhouhao wrote on 2013-06-03:
Pdfcrowd is cool.
And if it can generate pdf at server side, it will be cooler.
In my project, I try to implement this function:
1. fill the form in my page,
2. after submitting, the page will generate the form info into pdf, and store in the server side.

support wrote on 2013-06-04:

PDF is generated on our servers but it is possible to save it on your server.
Here is a PHP example:

    require 'pdfcrowd.php';

    // getFormHtml() is your function that generates HTML from submitted form data

    try { 
        $client = new Pdfcrowd("***", "***");
        $out_file = fopen("/path/to/fileName.pdf", "wb");
        $client->convertHtml(getFormHtml(), $out_file);
    catch(PdfcrowdException $why) {
        echo "Pdfcrowd Error: " . $why;
danish wrote on 2013-07-18:
may I ask what functionality does the getFormHtml() function performs? I am looking for a similar example that renders php variables to html and then generates pdf of it.