Download the PHP package intragile/php-text-extractor without Composer

On this page you can find all versions of the php package intragile/php-text-extractor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-text-extractor

PHP Text Extractor

Developed and maintained by IntrAgile Kft.

Tests Latest Version PHP

Extract plain text from PDF, Word, Excel, PowerPoint, OpenDocument, RTF, HTML, CSV and images with one call, for search indexes, RAG pipelines and archives.

Magyar nyelvű leírás → README.hu.md · Laravel? → intragile/laravel-text-extractor

Installation

Requires ext-mbstring. Install what your formats need:

Formats Needs
TXT, MD, CSV, TSV, JSON, RTF nothing else
XML ext-xmlreader
HTML ext-dom
DOCX, XLSX, PPTX, ODT, ODS, ODP ext-zip, ext-xmlreader
PDF pdftotext from poppler-utils
PNG, JPEG, TIFF, GIF, WebP, BMP tesseract and its language data

A missing extension or tool never throws: files of that format come back as Failed with reason missing_extension or missing_tool.

Results

extract(), extractFromString() and extractFromStream() always return an IntrAgile\TextExtractor\Result and never throw for problems with the input.

Property Type
status Status Extracted, Empty, NotExtractable or Failed
text string UTF-8, normalised line endings; '' unless Extracted
format ?Format detected format, e.g. Format::Docx
reason ?Reason why it is not a plain success
message ?string human-readable detail for logs
truncated bool the output limit was reached; a truncated result is always Extracted
Status Meaning Retry?
Extracted text was found –
Empty processed successfully, the file has no text no
NotExtractable the file can never be processed as it is no
Failed a technical problem; the file may succeed later yes
Reason Status When
unreadable Failed the file is missing or cannot be read
missing_extension Failed ext-zip, ext-xmlreader or ext-dom is not installed
missing_tool Failed pdftotext or tesseract is not installed
tool_timeout Failed the tool exceeded the timeout
parse_timeout Failed parsing done in PHP ran longer than maxParseSeconds; partial text is discarded
tool_failed Failed the tool crashed, ran out of memory or reported an error
internal_error Failed an extractor threw unexpectedly (please report it)
unsupported_format NotExtractable unknown format, legacy .doc/.xls/.ppt, encrypted Office file
too_large NotExtractable over maxInputBytes, or HTML over maxHtmlBytes
image_too_large NotExtractable a page or frame over maxImagePixels (checked before OCR starts)
encrypted NotExtractable password-protected PDF or OpenDocument file
corrupt NotExtractable damaged or structurally invalid file, e.g. an empty upload named .pdf
archive_limit_exceeded NotExtractable a zip-bomb limit was hit
no_text_layer Empty a PDF without a text layer, typically a scan

Input

Binary formats are recognised by their content, so a PDF called notes.txt is still a PDF. The file name chooses between TXT, Markdown, CSV, TSV, JSON, XML and HTML for text content, and it catches broken uploads: an empty or text-only file named .pdf, .docx, .png etc. is NotExtractable/corrupt, not an empty text file. Without ext-zip it also tells which Office format a zip container is meant to be.

What you get per format

Format Output
DOCX body, tables, text boxes, footnotes and endnotes; deleted tracked changes and field codes are left out
XLSX every sheet as ## Sheet name, then one line per non-empty row with cells separated by tabs (line breaks inside a cell become spaces); cached formula values; numbers formatted as dates or times in ISO 8601 form (2026-11-05, 2026-11-05T10:30:00, 10:30:00), the number format deciding which of the three is written; durations such as [h]:mm and other numbers as stored
PPTX slides in presentation order, separated by a blank line (empty paragraphs add no line inside a slide); each slide's speaker notes follow its text, without the notes page's header, footer or slide number
ODT / ODS / ODP as for DOCX / XLSX / PPTX; date and time cells in the same ISO 8601 notation as XLSX, taken from the stored value (a duration of a day or more keeps its displayed text); annotations and tracked deletions are left out; templates (OTT, OTS, OTP) and Writer/Web documents are read the same way
RTF text with paragraphs; font tables, pictures and other metadata are skipped
HTML visible text with block elements on separate lines; scripts and styles are dropped; the <head> title first
XML text and CDATA content
CSV / TSV / TXT / MD / JSON the text itself, decoded to UTF-8
PDF pdftotext output, pages separated by a blank line
Images Tesseract OCR in the configured languages; every page of a multi-page TIFF

Tables in DOCX, PPTX, ODT, ODP and HTML come out like spreadsheet rows: one row per line, cells separated by a tab, paragraphs inside a cell joined by a space.

Options

Option Default
maxInputBytes 100 MiB larger files are too_large
maxOutputBytes 10 MiB longer text is cut on a UTF-8 boundary and truncated is set
maxArchiveEntryBytes 256 MiB decompressed bytes allowed from one zip entry
maxArchiveTotalBytes 512 MiB decompressed bytes allowed from one file
maxArchiveEntries 10 000 entries allowed in one zip container
maxHtmlBytes 10 MiB larger HTML is too_large; libxml builds the DOM in native memory, outside memory_limit: 10 MiB of dense markup peaks at about 460 MB RSS on Linux (160 MB for plain prose)
maxImagePixels 16 000 000 images with a larger page or frame are refused before OCR
processTimeout 60 s per external tool run
maxParseSeconds 60 s parsing done in PHP (XML, OOXML, OpenDocument, RTF, text, CSV, HTML) for one call; over it the result is Failed / parse_timeout
processMemoryMb 512 address-space cap per tool on Linux; 0 disables it
pdftotextBinary null path or command name; null searches the PATH
tesseractBinary null path or command name; null searches the PATH
ocrLanguages eng Tesseract languages joined with +; all must be installed
fallbackEncoding Windows-1252 for text files that are not valid UTF-8; any mbstring encoding, plus built-in Windows-1250, 1253, 1255–1258, CP874 and CP437

$options->with(['maxOutputBytes' => 1_000_000]) returns a modified copy.

Custom extractors

Implement IntrAgile\TextExtractor\Contracts\Extractor and register it; it is tried before the built-in extractors.

Return raw text; normalisation, the output cap and the empty-text check are applied for you. Throw IntrAgile\TextExtractor\Exception\CorruptInput for a damaged file (NotExtractable/corrupt); any other exception becomes Failed/internal_error.

Security

The package is meant for untrusted uploads:

See SECURITY.md to report a vulnerability.

Compared with

License

MIT, see LICENSE.


Developed and maintained by IntrAgile Kft..


All versions of php-text-extractor with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package intragile/php-text-extractor contains the following files

Loading the files please wait ...