action dataflowkit_url_to_pdf { label: "Save web page as PDF" description: "Automate URL to PDF Conversion right in your application.\n\nSpecify request parameters like URL, Proxy, and actions to render web pages to PDF using Headless Chrome.\n\nGet resulted PDF even from websites blocked in your area for some reason utilizing our worldwide pool of proxies.\n\nSimulate real-world human interaction with the page. For example, before saving a web page to PDF, you may need to scroll it.\n\nGenerate ready-to-run code for your favorite language at [https://dataflowkit.com/url-to-pdf](https://dataflowkit.com/url-to-pdf)" provider: dataflowkit method: POST path: "/convert/url/pdf" encoding: json input: { type: "object" required: ["url"] properties: { actions: { type: "array" description: "Use actions to automate manual workflows while rendering web pages. They simulate real-world human interaction with pages." items: { type: "object" } } ignoreHTTPStatusErrCodes: { type: "boolean" description: "The HTTP 200 OK success status response code indicates that the request has succeeded. Sometimes a server returns normal HTML content even with an erroneous Non-200 HTTP response status code. The IgnoreHTTPStatusCode option is useful when you need to force the return of HTML content. Defaults to \"false.\"" } initialCookies: { type: "array" description: "The \"Initial Cookies\" option is useful for crawling websites that require a login. The simplest solution to get an array of cookies for specific websites is to use a web browser \"EditThisCookie\" extension. Copy a cookie array with \"EditThisCookie\" and paste it into the \"Initial cookie\" field." items: { type: "object" description: "InitialCookie structure keep cookies that optionally can be passed to the new fetcher crawl a website that requires a login. Generate Cookies array with EditThisCookie chrome extension." properties: { domain: { type: "string" } expirationDate: { type: "number" } hostOnly: { type: "boolean" } httpOnly: { type: "boolean" } id: { type: "number" } name: { type: "string" } path: { type: "string" } sameSite: { type: "string" enum: ["unspecified", "strict", "lax", "no_restriction"] } secure: { type: "boolean" } session: { type: "boolean" } storeID: { type: "string" } value: { type: "string" } } } } landscape: { type: "boolean" description: "Paper orientation. Parameter landscape = false means portrait orientation. Set landscape to true for landscape page oriantation." } marginBottom: { type: "number" description: "Bottom Margin of the PDF (in inches)" } marginLeft: { type: "number" description: "Left Margin of the PDF (in inches)" } marginRight: { type: "number" description: "Right Margin of the PDF (in inches)" } marginTop: { type: "number" description: "Top Margin of the PDF (in inches)" } output: { type: "string" description: "If set to _file_, the resulted PDF is uploaded to Dataflow Kit Storage first. Then the link to this file is returned. Overwise, PDF content is returned in the response body." enum: ["buffer", "file"] } pageRanges: { type: "string" description: "Specify page ranges to convert. Defaults to the empty value, which means convert all pages." } paperSize: { type: "string" description: "Page size parameter consists of the most popular page formats." enum: ["A3", "A4", "A5", "A6", "Letter", "Legal", "Tabloid"] } printBackground: { type: "boolean" description: "Print background graphics in the PDF." } printHeaderFooter: { type: "boolean" description: "printHeaderFooter parameter consists of the date, name of the web page, the page URL, and how many pages the document you are printing." } proxy: { type: "string" description: "Specify proxy by adding [country ISO code](https://en.wikipedia.org/wiki/ISO_3166-2) to `country-` value to send requests through a proxy in the specified country. Use `country-any` to use random geo-targets." } scale: { type: "number" description: "By default, PDF document content is generated according to dimensions of the original web page content. Using the `scale` parameter, you can specify a custom zoom factor from 0.1 to 5.0 of the webpage rendering." } url: { type: "string" description: "The full URL address (including HTTP/HTTPS) of a web page that you want to save as PDF" } waitDelay: { type: "number" description: "Specify a wait delay (in seconds). This may be useful if certain elements of the web site need to be rendered after the initial page load." } } } output: { type: "object" additionalProperties: true } }