A practical
HTML to PDF API
Stop yak-shaving,
generate a PDF now!
Whether you need invoices for your
e-commerce
or advanced reports
for your moonshot startup,
don't get distracted!
Leave the PDF generation to us
and stay focused on your core business.
curl --request POST \
--url https://yakpdf.p.rapidapi.com/pdf \
--header 'content-type: application/json' \
--header 'x-rapidapi-host: yakpdf.p.rapidapi.com' \
--header 'x-rapidapi-key:{{YOUR_APY_KEY}}' \
--data '{
"pdf": {
"format": "A4",
"printBackground": true
},
"source": {
"html": "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"></head><body><h1>Hello World!</h1></body></html>"
},
"wait": {
"for": "navigation", "timeout": 250, "waitUntil": "load"
}
}' > testPdf.pdf
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yakpdf.p.rapidapi.com/pdf"))
.header("content-type", "application/json")
.header("x-rapidapi-key", "{{YOUR_APY_KEY}}")
.header("x-rapidapi-host", "yakpdf.p.rapidapi.com")
.method("POST", HttpRequest.BodyPublishers.ofString("{ \"pdf\": { \"format\": \"A4\", \"printBackground\": true, \"scale\": 1 }, \"source\": { \"html\": \"<!DOCTYPE html<<html lang=\\\"en\\\"<<head<<meta charset=\\\"UTF-8\\\"<<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\"<</head<<body<<h1<Hello World!</h1<</body<</html<\" }, \"wait\": { \"for\": \"navigation\", \"timeout\": 250, \"waitUntil\": \"load\" }}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
import http.client
conn = http.client.HTTPSConnection("yakpdf.p.rapidapi.com")
payload = "{ \"pdf\": { \"format\": \"A4\", \"printBackground\": true, \"scale\": 1 }, \"source\": { \"html\": \"<!DOCTYPE html<<html lang=\\\"en\\\"<<head<<meta charset=\\\"UTF-8\\\"<<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\"<</head<<body<<h1<Hello World!</h1<</body<</html<\" }, \"wait\": { \"for\": \"navigation\", \"timeout\": 250, \"waitUntil\": \"load\" }}"
headers = {
'content-type': "application/json",
'x-rapidapi-key': "{{YOUR_APY_KEY}}",
'x-rapidapi-host': "yakpdf.p.rapidapi.com"
}
conn.request("POST", "/pdf", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const settings = {
"async": true,
"crossDomain": true,
"url": "https://yakpdf.p.rapidapi.com/pdf",
"method": "POST",
"headers": {
"content-type": "application/json",
"x-rapidapi-key": "{{YOUR_APY_KEY}}",
"x-rapidapi-host": "yakpdf.p.rapidapi.com"
},
"processData": false,
"data": "{ \"pdf\": { \"format\": \"A4\", \"printBackground\": true, \"scale\": 1 }, \"source\": { \"html\": \"<!DOCTYPE html<<html lang=\\\"en\\\"<<head<<meta charset=\\\"UTF-8\\\"<<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\"<</head<<body<<h1<Hello World!</h1<</body<</html<\" }, \"wait\": { \"for\": \"navigation\", \"timeout\": 250, \"waitUntil\": \"load\" }}"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
For other implementations check the code
on Rapidapi!
If you want to implement your own client or tweak all the options, check the !
For other implementations
check the code
on Rapidapi!
If you want to implement your own client
or tweak all the options,
check the !
Practical
Use technologies that your team already knows —get it done today.
Simple
Get a PDF with just one HTTP call
or tune all the settings if you want.
Fairly priced
Family business or planet scale company we have a plan for you.
Secure
We handle your data with care
and we don't keep any.
Reliable
Don't fear the Black Friday rush ,
we can handle any load or burst.
Supported
We are a small team, but we put
our customers first—get in touch.
Practical
Use technologies that your team already knows —get it done today.
Simple
Get a PDF with just one HTTP call
or tune all the settings if you want.
Fairly priced
Family business or planet scale company we have a plan for you.
Secure
We handle your data with care
and we don't keep any.
Reliable
Don't fear the Black Friday rush ,
we can handle any load or burst.
Supported
We are a small team, but we put
our customers first—get in touch.
Simple Pricing
Choose the best plan for your needs.
Looking for
an ENTERPRISE plan?
Let's talk!Why HTML-to-PDF?
Choosing the right library or tool is a time consuming activity. You have to consider requirements, team background, tech stack and more.
HTML-to-PDF is a pragmatic approach to PDF generation. It let you reuse technologies that you already know (HTML, CSS and JS) to build professional documents with the power of a modern browser engine.
Grid layout, SVG or WebFont? Whatever works on Chromium works with yakpdf! All bundled in a simple, yet configurable, API that you can call from any language.
Why Software as a service?
Creating PDF is as easy as printing a webpage in your browser—behind the scenes we do just that!
You could do the same, check out the puppeteer project.
There is a catch though, you have to deploy and maintain your own instances of Chromium, which is known to be greedy for resources.
With a vertical focus on this task, we invested our time perfecting the infrastructure for you.
We rely on AWS cloud to deliver a robust, fast and scalable service.