Convert URLs and HTML Code to PDF with PHP

Our API is a free solution for converting web pages and HTML documents to PDF with PHP.
Here is a simple example:


$data = array("apikey"   => "YOUR_API_KEY", 
              "html"     => "<p>My first pdf with <b>.Maui APIs</b>.</p>");

$curl = curl_init("");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 

$output = curl_exec($curl);  


$downloadPath = "download/mypdf.pdf";
$file = fopen($downloadPath, "w+");
fputs($file, $output);


Leave a Comment

Your email address will not be published. Required fields are marked *