Skip to content

ExtractText

Extracts the text content of a file.

1
2
3
4
5
myFiles.ExtractText(id: string):string



myFiles.ExtractText(id: string, format: ( `"plaintext"` | `"markdown"` )):string

Parameters

string id
    The ID of the file.

( "plaintext" | "markdown" ) format

Returns

The extracted plain text, or Markdown when requested.

Remarks

Documents are extracted as Markdown first and converted to plain text by default. When extraction is not possible, it returns an empty string.

Example

1
2
var extractedText = $Files.ExtractText(fileId);
var extractedMarkdown = $Files.ExtractText(fileId, "markdown");