v1

latestSwagger 2.02026-07-1371041.4 KB
PDF To Text

Extract text from a PDF, or search within a PDF

Two operations selected by action:

  • Convert (default) — extract text, returned as text/plain (or text/html if output_format=Html) in the response body.
  • Search — find a substring; response is JSON array of { page, x, y, width, height } text-position objects.

Input is either a multipart upload (form field file) or a url referencing a PDF.

post/api2/pdftotext

Request body

keystring uuid required
asyncboolean
action'Convert' | 'Search'

Convert extracts text; Search returns matching {page,x,y,w,h} boxes for search_text.

urlstring

URL to the PDF input. Alternative to a multipart upload.

start_pageinteger

First page to process (1-based).

end_pageinteger

Last page to process. 0 = last page of the document.

user_passwordstring

Password for opening encrypted input PDFs.

text_layout'Original' | 'Reading'

Original preserves the PDF's spatial layout; Reading reorders into reading sequence.

output_format'Text' | 'Html'
timeoutinteger
search_textstring

Substring to find when action=Search.

case_sensitiveboolean
whole_words_onlyboolean
raw_parametersstring

Response

Plain text (or HTML, or JSON array for Search) in body.