Attest tools · PDF tools

Extract pages from PDF

Extract page 2 from a two-page sample PDF into a separate one-page file.

1 credit per successful call

Input JSON

{
  "operation": "extract_pages",
  "file_base64": "PDF file, 1.3 KB, base64 in the real request",
  "pages": "2"
}

Captured output JSON

{
  "operation": "extract_pages",
  "source": "upload",
  "bytes_in": 1323,
  "pages_in": 2,
  "pages_selected": [
    2
  ],
  "pages_out": 1,
  "bytes": 900,
  "content_type": "application/pdf",
  "file_base64": "PDF file, 900 bytes, base64 in the real response",
  "limits": {
    "max_input_bytes": 6291456,
    "max_total_input_bytes": 12582912,
    "max_output_bytes": 2500000,
    "max_text_bytes": 1000000,
    "max_merge_files": 10,
    "max_split_files": 20,
    "max_pages_selected": 2000,
    "max_png_pages": 10,
    "max_pixels_per_page": 4000000,
    "max_decompressed_bytes": 33554432,
    "max_render_decompressed_bytes": 8388608,
    "png_scale_range": [
      0.1,
      5
    ],
    "effective_max_input_bytes": 2500000,
    "effective_input_note": "extract_pages returns one produced file, so the binding limit is max_output_bytes (2500000 bytes), not max_input_bytes. A document larger than that comes back as output_too_large (413) however it was sent."
  },
  "source_note": "Read from the PDF file itself — its page tree, its Info dictionary and its content streams. Metadata strings such as producer, creator, title and author are what the tool that wrote the file put there; they describe the document, are not checked against anything, and are general information only.",
  "checked_at": "2026-10-20T20:47:49.526Z"
}

API call

curl -s -X POST https://getattest.com.au/api/v1/pdf \
  -H "authorization: Bearer $ATTEST_API_KEY" \
  -H "content-type: application/json" \
  --data-binary @request.json

Run this call with your own bearer key. Save the complete input as request.json, replacing file descriptions with your own base64 file content and any truncated text with the full text. Issue an API key.

About this example

The input was validated and run locally through the registered service. The output above is a display preview of the captured service result. File bytes are described instead of printed, and strings longer than 400 characters are truncated; the HTTP API also adds call_id, credits_charged and credits_remaining. Timestamps and generated identifiers will vary.

Source: apps/api/svc/pdf_tools.mjs

Tool reference and limits · API key guide