Generate PDF from URL WEB

FREEMIUM
Por printAPI | Actualizada hace 2 meses | Business Software
Health Check

N/A

Volver a todos los tutoriales (2)

1. How to subscribe and convert simple webpage to pdf?

How to convert webpage to pdf?

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.

1.Visit our API description page

Start with visiting our API endpoints page

2. Activate free subscription to test API

  1. Press this button to subscribe to API
    subscription-page
  2. Pick free plan to try our API
    pick-plan
  3. Enter your CC details, we wonโ€™t charge at start
    enter-cc

3.Put your url as test param in Rapid API request body builder

For starting you can put this example as request body into Rapid API request body.

{
    "url": "https://news.ycombinator.com/",
    "inline": false
}

4. Copy and paster code into terminal

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

code-in-terminal

5. Preview result and see your gorgeous PDF

Run this command in terminal open file.pdf, or open file in File manager
see-result

You are gorgeous!

Thatโ€™s all for this tutorial, in next chapters youโ€™ll learn:

  • how to modify PDF with custom CSS
  • how to pass cookies to access paywalled content
  • how to change wait for setting to get better result