Hello dear reader in this tutorial I will show you how to use Composify API to generate PDF for any page you want. Let’s start with simple example. First things first, you need to subscribe to Free basic plan for our API first.
Start with visiting our API endpoints page
For starting you can put this example as request body into Rapid API request body.
{
"url": "https://news.ycombinator.com/",
"inline": false
}
Then select code snippets and pick (Shell) cURL to test it in your shell, you should see similar command. Note we added --output file.pdf
flag to save result as file.
curl --request POST \
--url https://generate-pdf-from-url-web.p.rapidapi.com/pdf \
--header 'content-type: application/json' \
--header 'x-rapidapi-host: generate-pdf-from-url-web.p.rapidapi.com' \
--header 'x-rapidapi-key: <YOUR_RAPID_API_KEY_HERE>' \
--data '{
"url": "https://news.ycombinator.com/",
"inline": true
}' \
--output file.pdf
Run this command in terminal open file.pdf
, or open file in File manager
That’s all for this tutorial, in next chapters you’ll learn: