v1

latestOpenAPI 3.1.02026-08-06244570.4 KB
PDF Tools

Extract pages from a PDF

Return a single PDF containing only the selected pages of the input, in the order specified. Replaces the need for splitting + reassembling client-side.

Pages syntax: 1-indexed, comma-separated. Supports ranges (1-3) and singles (5). Order is preserved: 5,1,3 outputs those 3 pages in that order.

Credits: 1 credit per call.

post/v1/pdf-tools/extract-pages

Request body

export_type'url' | 'binary'
expirationinteger

URL expiration in seconds. Min 60, max 604800. Only applies to url export type.

filenamestring nullable

Custom filename (without .pdf). Defaults to a generic name.

pdf_urlstring nullable

Public HTTPS URL to download the PDF from

pdf_base64string nullable

PDF file encoded as a base64 string

pagesstring required

1-indexed page selection. Supports ranges and singles separated by commas, e.g. 1-3, 5, 7-9. Order is preserved (5,1,3 outputs those 3 pages in that order).

Example request

{
  "filename": "merged",
  "pdf_url": "https://example.com/file.pdf",
  "pdf_base64": "JVBERi0xLjQKJ...",
  "pages": "1-3, 5, 7-9"
}

Response

Successful Response

urlstring required

Signed URL to download the PDF

filenamestring required

Filename of the resulting PDF

credits_remaininginteger required

Remaining credits after this request

expires_ininteger required

Seconds until the signed URL expires