function extractMarkdownFromFile(file, options): Promise<string>

converts a file to markdown (ImageFile or PdfFile).

Examples

import { extractMarkdownFromFile } from "@intuned/sdk/ai-extractors";

const markdown = await extractMarkdownFromFile({
  source: {
    type: "url",
    data: "<file url>"
  },
  type: "pdf",
  // pages array is optional, do not pass it if you want to include all pages in the process
  pages: [1, 2]
}, {
  label: "extract_markdown"
});

console.log(markdown);

Parameters

file: ImageFile | PdfFile | SpreadsheetFile

The file you want to extract the markdown content from.

options

options.label: string

A label for this extraction process, used for billing and monitoring.

Returns

Promise<string>

A promise that resolves to the extracted markdown content as a string.