This method converts scanned PDF documents (where pages are fully or partially made from scanned images) or image files into a text-searchable PDF. It runs OCR and adds an invisible text layer on top of your document that can be used for text search, text indexing, etc.
URL to the source file url attribute.
Set the language for OCR (text from image) to use for scanned PDF, PNG, and JPG documents input when extracting text. see Language Support. You can also use 2 languages simultaneously like this: eng+deu (any combination).
"eng+deu"
Page indices/ranges (0-based). Items are comma-separated. Each item is one of: N (e.g., 0), N-M (e.g., 3-7), N- (open-ended, e.g., 10-), or !N (reverse index; !0 is last page, !1 is second-to-last). Whitespace is allowed. If not specified, the default configuration processes all pages.
"0,2,5-10, !0, !5-!2"
File name for generated output.
Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks
Password for the PDF file.
Sets the expiration time for the output link, in minutes. After this period, generated output file(s) are automatically deleted from PDF.co Temporary Files Storage. The maximum allowed duration depends on your subscription plan. For permanent storage of input files (e.g., reusable images, PDF templates, documents), use PDF.co Built‑In Files Storage.
Defines coordinates for extraction. UsePDF Edit Add Helper to get or measure PDF coordinates. The format is {x} {y} {width} {height}.
"10 20 300 400"
HTTP auth user name if required to access source URL.
HTTP auth password if required to access source URL.
Success.
Status of the API response.
"success"
Descriptive message for the response status.
"Success"
URL to the output file.
"https://pdf-temp-files.s3.us-west-2.amazonaws.com/output.pdf"
Unique identifier for the job.
"6YSZD3U872ZYYFEDMQCQSGEEO8YSF5WA"
Credits used for this operation.
2
Credits remaining after this operation.
1480582
Time taken to complete the request, in milliseconds.
33