Download the PHP package hosmelq/laravel-anydoc without Composer

On this page you can find all versions of the php package hosmelq/laravel-anydoc. 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 laravel-anydoc

Laravel anydoc

Convert documents to GitHub-Flavored Markdown in Laravel applications, with access to anydoc's structured document model when available.

Requirements

Installation

Install the native extension with PIE:

Install Laravel anydoc with Composer:

Convert documents

Convert a local file to Markdown with the Anydoc facade:

file() also accepts an uploaded file:

Convert document bytes directly:

CSV has no content signature, so CSV bytes require an explicit format:

All conversions run synchronously.

Convert files from disks

Convert a file stored on a Laravel filesystem disk:

Call Anydoc::disk() without a name to use Laravel's default disk.

Disk files and uploaded files are read into memory before conversion.

Read structured documents

Call document() to access anydoc's readonly document model:

The document model includes blocks, checkboxes, embedded assets, inline content, lists, math, notes, and tables.

PDF supports Markdown conversion only. Calling document() for a PDF throws an Anydoc\Exception\UnsupportedException.

Supported formats

Format Extensions
CSV .csv
EPUB .epub
Excel .xls, .xlsb, .xlsm, .xlsx
OpenDocument .odp, .ods, .odt
PDF .pdf
PowerPoint .pot, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx
Rich Text Format .rtf
Word .doc, .docm, .docx

Pass a Format enum case when the format cannot be detected from the content:

Detect formats

Detect a format from bytes, an extension, or a path:

Each method returns a Format enum case or null. Extension detection is case-insensitive and accepts an optional leading dot.

Uploaded files use their contents first and their original name as a fallback. Filesystem files use their contents first and their path as a fallback.

Use dependency injection

Inject the Anydoc contract when a class should not depend on the facade:

Handle errors

Native conversion errors extend Anydoc\Exception\ConvertException:

Conversion exceptions include EncryptedException, IoException, MalformedException, MissingPartException, NeedsOcrException, ResourceLimitException, and UnsupportedException. NeedsOcrException provides the 1-indexed PDF pages requiring OCR through $pages and the total number of pages through $pageCount. Filesystem sources may also throw Laravel filesystem exceptions when their contents cannot be read.

PanicException represents a panic from the native Rust library and does not extend ConvertException.

Test conversions

Call Anydoc::fake() to test application behavior without reading files or running conversions:

Use a closure when the response depends on the recorded conversion:

The fake provides assertions and access to recorded conversions:

Assertion and filtering callbacks receive a RecordedConversion containing its disk, format, input, output type, and source type. A conversion is recorded when markdown() or document() is called.

The default fake Markdown response is an empty string. Document conversions require a configured Anydoc\Document response.

Development

Run the test suite with:

Changelog

See CHANGELOG.md for a list of changes.

Contributing

Pull requests are welcome. Please run the test suite before submitting changes.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-anydoc with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-anydoc Version ^0.2.4
illuminate/filesystem Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
spatie/laravel-package-tools Version ^1.93
thecodingmachine/safe Version ^3.4
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 hosmelq/laravel-anydoc contains the following files

Loading the files please wait ...