mindee
    Preparing search index...

    Class BufferInput

    Hierarchy

    • LocalInputSource
      • BufferInput
    Index

    Constructors

    Properties

    filename: string = ""
    fileObject: string | Buffer<ArrayBufferLike>
    filepath?: string
    initialized: boolean = false
    inputType: string
    mimeType: string = ""

    Methods

    • Compresses the file object, either as a PDF or an image.

      Parameters

      • quality: number = 85

        Quality of the compression. For images, this is the JPEG quality. For PDFs, this affects image quality within the PDF.

      • maxWidth: number | null = null

        Maximum width for image resizing. Ignored for PDFs.

      • maxHeight: number | null = null

        Maximum height for image resizing. Ignored for PDFs.

      • forceSourceText: boolean = false

        For PDFs, whether to force compression even if source text is present.

      • disableSourceText: boolean = true

        For PDFs, whether to disable source text during compression.

      Returns Promise<void>

      A Promise that resolves when the compression is complete.

    • Protected

      Returns the file object as a Buffer.

      Returns 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.

      Returns Promise<number>

      Promise The number of pages

    • Returns true if the object is a PDF and has source text. False otherwise.

      Returns Promise<boolean>

      boolean

    • Determines whether the current file is a PDF.

      Returns boolean

      Returns true if the file is a PDF; otherwise, returns false.