Download the PHP package hosmelq/ext-anydoc without Composer
On this page you can find all versions of the php package hosmelq/ext-anydoc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hosmelq/ext-anydoc
More information about hosmelq/ext-anydoc
Files in hosmelq/ext-anydoc
Package ext-anydoc
Short Description PHP extension for converting documents to GitHub-Flavored Markdown with Firecrawl anydoc.
License MIT
Informations about the package ext-anydoc
ext-anydoc
Native PHP bindings for Firecrawl anydoc to convert Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF files to GitHub-Flavored Markdown.
Starting with v0.2.0, extension releases match the anydoc version they embed.
This community project is not affiliated with, endorsed by, or maintained by Firecrawl.
Requirements
- PHP 8.4+.
- PIE 1.4+.
Installation
Install the extension with PIE:
Prebuilt binaries are available for PHP 8.4 and 8.5 on Linux glibc x64 and ARM64, macOS Intel and Apple Silicon, and Windows x64. Linux and Windows include NTS and ZTS builds; macOS includes NTS builds. Other Unix targets build from source and require matching PHP development headers and Rust 1.88+.
Usage
Conversions are synchronous. CSV bytes require an explicit csv format.
The document model is unavailable for PDF; use anydoc_to_markdown_bytes().
Supported formats
| Format | Extensions |
|---|---|
| CSV | .csv |
| EPUB | .epub |
| Excel | .xls, .xlsb, .xlsm, .xlsx |
| OpenDocument | .odp, .ods, .odt |
.pdf |
|
| PowerPoint | .pot, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx |
| Rich Text Format | .rtf |
| Word | .doc, .docm, .docx |
API
anydoc_format_from_bytes(string $bytes): ?stringanydoc_format_from_extension(string $extension): ?stringanydoc_format_from_path(string $path): ?stringanydoc_to_document(string $bytes, ?string $format = null): Anydoc\Documentanydoc_to_markdown(string $path): stringanydoc_to_markdown_bytes(string $bytes, ?string $format = null): string
Anydoc\Document exposes readonly assets, blocks, and notes, including
checkbox and math nodes. Embedded asset data is binary-safe. See
stubs/anydoc.stub.php for the complete model API.
Errors
Catch Anydoc\Exception\ConvertException for conversion failures. Its concrete
types are EncryptedException, IoException, MalformedException,
MissingPartException, NeedsOcrException, ResourceLimitException, and
UnsupportedException. Each concrete conversion exception exposes
ERROR_CODE; some also expose detail, limit, pageCount, pages, or
part. Rust panics surface as PanicException.
NeedsOcrException::$pages contains the 1-indexed PDF pages requiring OCR,
while $pageCount contains the total number of pages.
License
Released under the MIT License.