Documentation

PdfExtractor
in package

PDF extraction class.

Table of Contents

Properties

$pageCount  : int
$fileName  : string
$pdfBytes  : string

Methods

__construct()  : mixed
extractInvoices()  : array<string|int, ExtractedPdf>
Extracts invoices as complete PDFs from the document.
extractSubDocuments()  : array<string|int, ExtractedPdf>
getFileName()  : string
buildSubDocument()  : string

Properties

$pageCount

public int $pageCount

number of pages in the file

$fileName read-only

private string $fileName

name of the file

$pdfBytes

private string $pdfBytes

bytes representation of a file

Methods

extractInvoices()

Extracts invoices as complete PDFs from the document.

public extractInvoices(array<string|int, array<string|int, int>> $pageIndexes[, bool $strict = false ]) : array<string|int, ExtractedPdf>
Parameters
$pageIndexes : array<string|int, array<string|int, int>>

List of sub-lists of pages to keep.

$strict : bool = false

Whether to trust confidence scores or not.

Tags
throws
Exception
Return values
array<string|int, ExtractedPdf> —

a list of extracted invoices

extractSubDocuments()

public extractSubDocuments(array<string|int, array<string|int, int>> $pageIndexes) : array<string|int, ExtractedPdf>
Parameters
$pageIndexes : array<string|int, array<string|int, int>>

List of page-index groups.

Tags
throws
MindeePdfException

Throws if bernard_ledit can't handle the PDF during the extraction.

InvalidArgumentException

Throws if a group of page indexes is empty.

Return values
array<string|int, ExtractedPdf> —

list of extracted documents

getFileName()

public getFileName() : string
Return values
string —

name of the file

buildSubDocument()

private static buildSubDocument(PdfDocument $source, array<string|int, int> $pageIndexes) : string
Parameters
$source : PdfDocument
$pageIndexes : array<string|int, int>
Tags
throws
MindeePdfException
Return values
string
On this page

Search results