Skip to content

Instantly share code, notes, and snippets.

@apexdodge
Created July 18, 2018 21:45
Show Gist options
  • Save apexdodge/849bf9f536704605f05700f9a7874423 to your computer and use it in GitHub Desktop.
Save apexdodge/849bf9f536704605f05700f9a7874423 to your computer and use it in GitHub Desktop.
require('../_lib/libraries/sys/api2pdf/api2pdf.php'); //link this to your external library, whatever your file is named.
$apikey = "YOUR-API-KEY";
$payload = array("html"=>"<p>Hello World</p>", "inlinePdf"=> true, "fileName"=> "test.pdf");
$res = wkhtmltopdf_to_pdf($apikey, $payload);
header("Location: ".$res->pdf); //this redirects to the PDF. Remove this if you don't want to do that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment