Extract PDF pages (PDFSharp)
api2pdf_extract_pagesExtract a range of pages from an existing PDF (given as a URL) into a new PDF. start/end are 0-based page indices; omit end to extract a single page. Returns a { FileUrl } (valid ~24h). BILLED. Api2Pdf API: POST /pdfsharp/extract-pages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | 0-based index of the last page to extract. Omit for a single page (just `start`). | |
| url | Yes | URL of the source PDF. | |
| start | No | 0-based index of the first page to extract. Default 0. | |
| inline | No | If true (Api2Pdf default), the generated file is served inline; if false, as an attachment. | |
| options | No | Engine-specific render options (page size, margins, orientation, headers/footers, etc.). Passed through verbatim to Api2Pdf. | |
| storage | No | Custom storage target, used when useCustomStorage is true. | |
| fileName | No | A name for the generated file, e.g. 'invoice.pdf'. | |
| output_binary | No | If true, return the raw file bytes as base64 instead of a FileUrl. Default false (recommended for agents — returns a short-lived link). | |
| extraHTTPHeaders | No | Extra HTTP headers Api2Pdf forwards when it fetches a source URL (e.g. auth for a protected page/file). | |
| useCustomStorage | No | If true, Api2Pdf uploads the result to your own storage (see `storage`) instead of hosting it. |