PdfProcessor
Defined in: src/lib/processors/PdfProcessor.ts:101
Processor for PDF files that extracts text content page by page.
Pages without a usable text layer (scanned pages, including scans inside an otherwise-digital document) are rendered as images, up to MAX_IMAGE_PAGES, so a vision model can read them. A note at the top of the text states exactly which pages arrived as images and which were left out.
Implements
Constructors
Constructor
new PdfProcessor():
PdfProcessor
Returns
PdfProcessor
Properties
name
readonlyname:"pdf"="pdf"
Defined in: src/lib/processors/PdfProcessor.ts:102
Unique identifier for this processor
Implementation of
supportedExtensions
readonlysupportedExtensions:string[]
Defined in: src/lib/processors/PdfProcessor.ts:104
File extensions this processor can handle (fallback if MIME type unavailable)
Implementation of
FileProcessor.supportedExtensions
supportedMimeTypes
readonlysupportedMimeTypes:string[]
Defined in: src/lib/processors/PdfProcessor.ts:103
MIME types this processor can handle
Implementation of
FileProcessor.supportedMimeTypes
Methods
process()
process(
file:FileWithData):Promise<ProcessedFileResult|null>
Defined in: src/lib/processors/PdfProcessor.ts:106
Process a file and extract text content
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
File metadata with data URL |
Returns
Promise<ProcessedFileResult | null>
Extracted text content and metadata, or null if processing fails/not applicable
Implementation of