Document Photo to Text AI
A powerful Node.js library for extracting text from various document formats using AI-powered OCR and specialized parsers. Supports multiple AI providers: Google Gemini, OpenAI, and Anthropic Claude.
Handles PDFs, images, Word documents, Excel spreadsheets, CSV files, HTML pages, YouTube videos, and 40+ formats total.
Features
- Multi-Provider AI — Choose your preferred AI provider: Gemini, OpenAI, Anthropic Claude, or bring your own
- 42 Supported Formats — PDFs, images, Word, Excel, PowerPoint, CSV, HTML, JSON, XML, YAML, code files, and more
- AI-Powered OCR — Uses AI vision models for accurate text extraction from images and scanned documents
- Works Without AI — Text-based formats (TXT, JSON, CSV, DOCX, XLSX, etc.) work without any AI provider
- YouTube Support — Extracts transcripts and metadata from YouTube videos
- Web Content — Scrapes and extracts text from any web page
- Buffer Support — Process files directly from memory buffers (great for uploads)
- Built-in Caching — Automatic caching for improved performance
- Custom Providers — Plug in any AI function as a custom provider
Installation
npm install document-photo-to-text-ai
Then install the AI provider SDK you want to use (only needed for image/OCR features):
# For Google Gemini
npm install @google/generative-ai
# For OpenAI (GPT-4o, GPT-4 Vision)
npm install openai