HTML to PDF API

Convert URLs and HTML Code to PDF

Our API is a free solution for converting web pages and HTML documents to PDF.

POSTGET *
https://api.dotmaui.com/client/1.0/htmltopdf/

Parameters

Field Type Description Required
apikey String

.Maui Api key

True

url String

A valid URL address

1

html String

An HTML string

1

1 There must be one of these values

 

Success 200 - Default Mode

Output will be to a pdf file


Testing calls

You can try this service through our API-based tool available here: https://dotmaui.com/api-powered/html-to-pdf.jsp


Examples

<?php

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

$curl = curl_init("https://api.dotmaui.com/client/1.0/htmltopdf/");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 

$output = curl_exec($curl);  

curl_close($curl);

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

Using client As New Net.WebClient
    Dim reqparm As New Specialized.NameValueCollection
    reqparm.Add("apikey", "YOUR_API_KEY")
    reqparm.Add("url", "https://example.com")
    Dim responsebytes = client.UploadValues("https://api.dotmaui.com/client/1.0/htmltopdf/", "POST", reqparm)
    System.IO.File.WriteAllBytes("C:\MyPdfFiles\Exmple.pdf", responsebytes)
End Using

* Only for premium users.