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?

<p>
<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">
</form>
</p>

<?php

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

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

require 'includes/pdfcrowd.php';

try
{
// 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:
Hello,

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

See details:
https://pdfcrowd.com/save-to-pdf/
maxx210690 wrote on 2017-08-16:
hello
i don't found my profile page
support wrote on 2017-08-16:
Hello,

You have to login to Pdfcrowd.
Please use the following link:
https://pdfcrowd.com/user/sign_in/