Opens a web page in headless Chrome using Puppeteer and prints it to PDF. The input is a JSON object such as: { "url": "https://www.wikipedia.org/", "sleepMillis": 2000, "pdfOptions": { ... } } The optional "sleepMillis" setting indicates how many milliseconds should the act wait after loading the page before printing it to PDF. The "pdfOptions" object is passed to Puppeteer's page.pdf() function - see https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions Output is a PDF file.

Last run
Used 8761 times

To run the actor, you'll need a free Apify account. Simply open the actor console by clicking the button below, modify the actor input configuration, click Run and get your results.


To run the actor from your code, send a HTTP POST request to the following API endpoint:


The POST payload including its Content-Type header is passed as INPUT to the actor (usually application/json). The actor is started with the default options; you can override them using various URL query parameters.

curl https://api.apify.com/v2/acts/jancurn~url-to-pdf/runs?token=<YOUR_API_TOKEN> \
-d '{
  "url": "https://www.wikipedia.org/",
  "sleepMillis": 2000,
  "pdfOptions": {
    "format": "a4"
}' \
-H 'Content-Type: application/json' \

To use the API, you'll need to replace <YOUR_API_TOKEN> with the API token of your Apify account (view here).

For more information, view the list of actor API endpoints or the full API reference.


Do you need to run the actor periodically? You can easily create a schedule that will run the actor any time you want.