Download the PHP package mattmy/laravel-dwg-converter without Composer
On this page you can find all versions of the php package mattmy/laravel-dwg-converter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mattmy/laravel-dwg-converter
More information about mattmy/laravel-dwg-converter
Files in mattmy/laravel-dwg-converter
Package laravel-dwg-converter
Short Description A Laravel-first wrapper for LibreDWG command-line converters.
License MIT
Informations about the package laravel-dwg-converter
Laravel DWG Converter
繁體中文
Laravel DWG Converter lets Laravel applications extract embedded thumbnails from DWG files and convert DWG files to DXF, structural JSON, PNG, JPEG, or WebP.
Features
- Extract embedded DWG thumbnails.
- Convert DWG files to ASCII DXF.
- Export DWG files as structural JSON.
- Create PNG, JPEG, or WebP previews.
- Accept uploaded files, local paths, or DWG bytes.
- Store or stream results with Laravel Storage.
Requirements
| Requirement | Supported |
|---|---|
| PHP | 8.3 or later |
| Laravel | 12 or 13 |
| CI-tested combinations | PHP 8.3–8.5 with Laravel 12–13, including the PHP 8.3 / Laravel 12 lowest boundary |
External commands are feature-specific. You do not need LibreOffice or ImageMagick when you only extract thumbnails, create DXF, or export JSON.
External commands by operation
| Operation | Required commands |
|---|---|
Dwg::thumbnail(...)->extract() |
LibreDWG dwgbmp |
Dwg::toDxf(...)->convert() |
LibreDWG dwg2dxf |
Dwg::toJson(...)->convert() |
LibreDWG dwgread with JSON output support |
Dwg::toImage(...)->convert() |
LibreDWG dwg2dxf, LibreOffice 7.4+ soffice, ImageMagick 7 magick |
The package does not download or bundle these tools. For LibreDWG installation, see the official LibreDWG repository. The external tools guide covers LibreOffice and ImageMagick installation on Ubuntu/Debian, RHEL/Fedora, and Windows.
Installation
Install the package with Composer:
If a required command is not on PATH, publish the configuration and provide its absolute path:
Quick start
This example extracts the DWG's embedded preview and streams it to Laravel's default disk. The source is
an UploadedFile from a validated request.
A DWG may not contain an embedded thumbnail. Use image conversion when you need a rendered preview:
Inputs and outputs
Every operation accepts a valid UploadedFile, a local absolute path, or bytes explicitly wrapped with
DwgBinary::from($bytes). A plain string is always treated as a path.
Each successful operation returns a one-time DwgOutput:
extension()andmimeType()inspect trusted output metadata without consuming it.storeAs()streams the artifact to Laravel Storage and cleans up temporary resources.output()returns all bytes as a string and should only be used for outputs that safely fit in PHP memory.
Errors and operational limits
Failures use LibreDwgUnavailable, InvalidDwg, or DwgOperationFailed. Each exception provides a stable
reason() and sanitized scalar context().
The default limits are 200 MiB input, 512 MiB general output, and 64 MiB JSON output. Set a byte limit to
null, zero, or a negative integer to disable it. Keep positive limits and run untrusted DWG conversions in
a resource-limited worker or container.
Successful conversion means the configured tools completed the requested operation and the artifact passed the package's format checks. It is not a DWG safety certification, a full conformance check, or an AutoCAD visual-fidelity guarantee.
Documentation
Read the complete English and Traditional Chinese documentation at mattmy.github.io/laravel-dwg-converter-doc.
Changelog
See CHANGELOG.md for the version history.
License
Laravel DWG Converter is released under the MIT License. LibreDWG is GPLv3+ software installed and distributed separately. LibreOffice and ImageMagick are also installed separately under their own licenses.
All versions of laravel-dwg-converter with dependencies
illuminate/filesystem Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
symfony/process Version ^7.0|^8.0