/
home
/
devanchordigital-mhlawqld
/
htdocs
/
mhlawqld.devanchordigital.com.au
/
pdf
/
up file
home
<? $ids = $_POST["ids"]; $issue = $_POST["type"]; $region = $_POST["region"]; $ids = implode(",", $ids); $filename = $issue."-".$region."-".substr(md5(time()), 0, 16); $filename = preg_replace("![^a-z0-9]+!i", "-", $filename); require_once('pdfcrowd/pdfcrowd.php'); $url = "https://mhlawqld.com.au/print-providers/?ids=".$ids."&issue=".$issue."®ion=".$region; try { // create the API client instance $client = new \Pdfcrowd\HtmlToPdfClient("aushost", "4033243e2831173125383d6184968c50"); $client->setPageSize("A4"); $client->setOrientation("portrait"); $client->setNoMargins(true); // run the conversion and write the result to a file $client->convertUrlToFile($url, $filename.".pdf"); } catch(\Pdfcrowd\Error $why) { // report the error error_log("Pdfcrowd Error: {$why}\n"); // rethrow or handle the exception throw $why; } echo "https://mhlawqld.com.au/pdf/".$filename.".pdf"; ?>