Compatibility Fully compatible with HTML, JS, CSS3
We use the Chrome rendering engine to perform the transformation so you can use all CSS you know and even execute some layout calculations with Javascript.
Demo Do you want to test it?
Just give as an URL, resolve the captcha and you will get a button to download you PDF. No email required, no annoying ads, ... just PDF, quick and simple.
Your PDF is ready!
DownloadFree API Key Do you want an API Key for free?
Just give as you email and we will generate one for you and send it to your email.
Check your inbox. We have sent you a free API Key.
Quotes How much profit can you take?
So far it is free but plans are to keep it very cheap. Being rich is outside my expectations and scope.
To avoid abuses, it´s currently limited to 15 request/hour.
API Documentation
Endpoint: | https://html2pdf.albinsoft.es/api/rest/generate | ||||||||
Querystring: |
|
¹ In case your site is behind basic authorization.
Advices To get a perfect outprint...
Despite it is not strictly necessari, for best fitting the screen in a paper, you can ...
- Use the
media print
. - Use units of measurement for printing like milimeters.
- Use break control like
break-after: avoid-page;
.
@media print {
/* paper safe inset area */
body {
margin: 15mm;
}
/* avoid page break inside this element */
ul {
break-after: avoid-page;
}
}
PHP Sample As simple as a GET request.
As it is a REST API you can use it from virtually any language or even the bash shell.
There is no need of a SDK, library, ... just the most simple HTTP verb.
$url = '…';
$path = '…';
if($curl = curl_init('https://html2pdf.albinsoft.es/api/rest/generate?key=……&url='.urlencode($url))) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$resp = curl_exec($curl);
$info = json_decode($resp);
curl_close($curl);
if($info===null) {
die('Failure: '.json_last_error_msg());
}
var_dump($resp);
}