Extract text from files
extract_file_textTurn files into text on the server: a PDF (its text layer, or OCR for scanned pages), or photos or scans of pages (one image per page, in reading order). Also reads plain-text files.
Use it before import_script for a screenplay that arrives as a PDF or as page images: then call import_script with the textId this returns. Never retype a long script with edit_script. For notes and other documents, read the returned text.
Pages with a text layer are free. Each page read by OCR costs about half a credit; when more than 20 pages need OCR, the call returns confirmation_required with the estimate: ask the user, then call again with confirm: true. At most 300 pages per file are read.
Returns the textId, per file the pages read by text layer and by OCR and any failedPages, the OCR spend of this call, and the text in pages of 60000 characters (pass nextOffset as offset for the next page). Calling again with the same files costs nothing for pages already read and retries failed pages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | No | https URLs of the files, in reading order: one PDF, or one image per page. | |
| offset | No | Character offset of the text to return (nextOffset of the previous call). | |
| confirm | No | True once the user agreed to the OCR estimate (needed above 20 pages to transcribe). | |
| projectId | Yes | ScreenWeaver project id (from list_projects). |