Skip to content
pdfconversionapi

PAGES to TXT API

POST /v2/convert/pages/to/txt reads the body text straight out of a Pages document, with no layout step, and returns it as UTF-8. Each paragraph becomes one line ending in LF: the sample's 17 paragraphs come back as 1,056 bytes.

Endpoint
POST /v2/convert/pages/to/txt
Accepts
pages
Sample timing
1 ms median of 5 runsHow we measure
Request size
Up to 10 MB on the Free plan or 100 MB on paid plans, all files together

Request and response

Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.

curl -sS -X POST \
  https://api.pdfconversionapi.com/v2/convert/pages/to/txt \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@garden-rules.pages \
  -o response.json

# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
  mkdir -p converted
  name=$(jq -r '.Files[0].FileName' response.json)
  jq -r '.Files[0].FileData' response.json \
    | base64 --decode > "converted/$name"
else
  cat response.json
fi
200 OK1 ms median1 file, 1.0 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.001,
  "Files": [
    {
      "FileName": "garden-rules.txt",
      "FileExt": "txt",
      "FileSize": 1056,
      "FileData": "TWFwbGUgU3RyZWV0IENvbW11…"
    }
  ]
}

Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.

The sample, converted

The same file the code sends. Download the input and the output and compare them yourself.

garden-rules.txt, 17 lines

Maple Street Community GardenPlot rules for the 2027 seasonWelcome back, growers. These rules were agreed at the October meeting. They apply to all 38 raised beds from March 1 to November 15.WateringThe two shared hoses hang on the north fence. From June to August, please water before 9 a.m. or after 6 p.m., and coil the hose when you finish.Rain barrels are for watering cans only.Report a dripping tap to the plot coordinator.Water a neighbor’s bed only when they ask you to.Keeping your plotBeds left unplanted for six weeks may be offered to the waiting list. Keep paths clear and cut back anything that leans over the edge of your bed.Compost bins are in the southeast corner. Green waste only: no meat, dairy or diseased tomato plants.Seed swapBring jalapeño, tomatillo and squash seeds to the swap table on May 2. Label each packet with the variety and the year it was saved.Tools and shedShed code	4-7-1-9 (changes on the 1st)Work hour	Saturdays, 10 a.m. to noonReturn tools clean. A sign-out sheet hangs inside the shed door.
Input
garden-rules.pages (44 KB)
Output
garden-rules.txt (1.0 KB)
Source
A two-page A5 Apple Pages document with garden rules we wrote; we put our text into a Pages test file from an open-source office suite's test data (MPL-2.0). How it was made
Made by
2026-11-04, API build 9eeeb0640aba

Parameters

Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.

ParameterWhat it does
FileNamestringName of the text file without the extension; by default garden-rules.txt.
StoreFileboolean, default falseReturn a link, valid for 3 hours, instead of the text.

What carries over, and what doesn't

Kept

  • Every paragraph of the body, in order, one per line: 17 lines for the sample
  • Tabs, as tab characters (2 in the sample)
  • Unicode text in UTF-8 without a byte order mark, including ’ and ñ
  • The words of list items, as plain lines

Lost or not yet supported

  • All formatting: title and heading sizes, bold, underline, bullets and page size.
  • Text outside the body, such as text boxes, headers and footers, when the document has body text. Only a document without body text is read from all its text storages, joined by blank lines.
  • Objects anchored in the text, such as images, which are left out.

Limits

  • The file is checked before it is read: more than 10,000 parts in the archive, or over 1 GiB once unpacked, returns 413.
  • A file that is not a zip archive returns 422 with a message that includes "invalid Zip archive".
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together. A conversion can run for up to 120 seconds; after that the API returns 504.

Where teams use it

Search indexes for uploaded documents

Index the words of .pages files next to Word and PDF files in your search, without converting every document to PDF first.

Feeding text to a language model or classifier

Plain text with one line per paragraph is ready to chunk for embeddings or to send to a model, with no markup to strip.

Checking Pages submissions automatically

Word counts, required phrases and plagiarism checks only need the text, which this route returns without any layout work.

Questions

What line endings and encoding does the text use?

LF line endings and UTF-8 without a byte order mark. LineEnding and SaveFormat are not read for Pages files: sending LineEnding=crlf or SaveFormat=wintext returned the same 1,056 bytes. If you need CRLF, change the line endings in your code.

Is the text laid out or extracted?

Extracted. The route reads the text the Pages file stores, without drawing pages, so it is not affected by fonts or page breaks. Page, section and column breaks become line breaks.

Does it read headers, footers and text boxes?

Only when the document has no body text, as in a layout made entirely of text boxes; then all text storages are joined, with a blank line between them. A document with body text returns the body only.

Do I need a Mac?

No. The Pages file is read on our servers by code that understands its archive format directly.

Convert your first PAGES file in a minute.