Original filename associated with the input.
File content loaded from disk.
OptionalfilepathOriginal filepath when available.
ProtectedinitializedWhether the source has already been initialized.
ReadonlyinputPath used to read the local file.
Type of local input source (path, stream, bytes, ...).
MIME type detected for the source content.
ProtectedcheckDetects and validates the MIME type from the current file object.
Compresses the file object, either as a PDF or an image.
Quality of the compression. For images, this is the JPEG quality. For PDFs, this affects image quality within the PDF.
Maximum width for image resizing. Ignored for PDFs.
Maximum height for image resizing. Ignored for PDFs.
For PDFs, whether to force compression even if source text is present.
For PDFs, whether to disable source text during compression.
A Promise that resolves when the compression is complete.
ProtectedgetProtectedReturns the file object as a Buffer.
Buffer representation of the file object
Returns the number of pages in the input source. For PDFs, returns the actual page count. For images, returns 1.
Promise
Returns true if the object is a PDF and has source text. False otherwise.
boolean
Reads the file from disk and validates MIME type.
Returns whether the input source has been initialized.
Determines whether the current file is a PDF.
Returns true if the file is a PDF; otherwise, returns false.
Local input source that reads a file from disk by path.