Attest tools · PDF tools

Extract text from PDF

Extract the selectable text from a two-page sample PDF while preserving page boundaries.

1 credit per successful call

Input JSON

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

Captured output JSON

{
  "operation": "extract_text",
  "source": "upload",
  "bytes_in": 1323,
  "pages_in": 2,
  "pages_read": 2,
  "pages": [
    {
      "page": 1,
      "chars": 41,
      "text": "Inventory report: cotton sheets 12 units.",
      "truncated": false
    },
    {
      "page": 2,
      "chars": 35,
      "text": "Care guide: cold wash and line dry.",
      "truncated": false
    }
  ],
  "text": "Inventory report: cotton sheets 12 units.\nCare guide: cold wash and line dry.",
  "chars": 77,
  "text_bytes": 76,
  "truncated": false,
  "timed_out": false,
  "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,
    "applied_decompressed_budget": 33554432,
    "png_scale_range": [
      0.1,
      5
    ],
    "effective_max_input_bytes": 6291456,
    "effective_input_note": "extract_text returns text and counts rather than a file, so max_input_bytes is the binding limit."
  },
  "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.509Z"
}

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