This is an archived forum post. The information may be outdated. Contact us if you have any questions.
<?php require 'pdfcrowd.php'; try { // create an API client instance $client = new Pdfcrowd("globalguide", "xxxxxxxxxxxxxxxxxxxxxxx"); // I used my real key :) $today = date("Ymd"); $filename = "newsletter/daily".$today.".pdf"; $handle = fopen($filename, "wb"); $client->setPageWidth("210mm"); $client->setPageHeight("297mm"); // convert a web page and store the generated PDF into a $pdf variable $client->convertURI('http://www.astronautical-news.com/edition.html', $handle); fclose($handle); } catch(PdfcrowdException $e) { echo "Pdfcrowd Error: " . $e->getMessage(); } ?>
curl -F username=globalguide \ -F key=xxxxxxxxxx \ -F width=210mm \ -F height=297mm \ -F src=http://www.astronautical-news.com/edition.html \ http://pdfcrowd.com/api/pdf/convert/uri/ > daily`date "+%Y%m%d"`.pdf
/absolute/path/to/newsletter/daily$(date +\%Y\%m\%d).pdf