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

beginner question

cotton wrote on 2017-06-23:
Can anyone tell me what is wrong with this?

<form id="getpdf" action="" enctype="multipart/form-data" method="post" name="getpdf">
<input class="black_button" style="width:150px;" id="getme" name="getme" type="submit" value="Save As PDF">


$actual_link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

if (isset($_POST['getme'])) {

require 'includes/pdfcrowd.php';

// create an API client instance
$client = new Pdfcrowd("myusername", "mykey");

// convert a web page and store the generated PDF into a $pdf variable
$pdf = $client->convertURI($actual_link);

// set HTTP response headers
header("Content-Type: application/pdf");
header("Cache-Control: max-age=0");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=\"report.pdf\"");

// send the generated PDF
echo $pdf;
catch(PdfcrowdException $why)
echo "Pdfcrowd Error: " . $why;

support wrote on 2017-06-26:

If you want to use Save as PDF link, just add
<a href="//">Save to PDF</a>
into your web page.

See details:
maxx210690 wrote on 2017-08-16:
i don't found my profile page
support wrote on 2017-08-16:

You have to login to Pdfcrowd.
Please use the following link: