Extracts text content from a given file.
This function supports extracting text from PDF and DOCX files. It throws an error if the file type is unsupported.
The file object of type MwFile containing the file's metadata and content.
MwFile
A promise that resolves to the extracted text content as a string.
If the file type is unsupported.
const file: MwFile = { name: 'example.pdf', type: 'application/pdf', arrayBuffer: someBuffer };const text = await extractTextFromFiles(file);console.log(text); Copy
const file: MwFile = { name: 'example.pdf', type: 'application/pdf', arrayBuffer: someBuffer };const text = await extractTextFromFiles(file);console.log(text);
Extracts text content from a given file.
This function supports extracting text from PDF and DOCX files. It throws an error if the file type is unsupported.