Skip to content

External tools ​

Requirements by operation ​

Public operationResultRequired commands
Dwg::thumbnail(...)->extract()Embedded BMP, PNG, or WMF previewLibreDWG dwgbmp
Dwg::toDxf(...)->convert()ASCII DXFLibreDWG dwg2dxf
Dwg::toJson(...)->convert()LibreDWG structural JSONLibreDWG dwgread with JSON output
Dwg::entities(...)->read()Entity data and diagnosticsLibreDWG dwgread with JSON output
Dwg::version(...)Stored DWG formatNone
Dwg::info(...)->read()Basic drawing informationLibreDWG dwgread with JSON output
Dwg::layers(...)->read()Layer data CollectionLibreDWG dwglayers with --flags and, for onlyOn(), --on
Dwg::toImage(...)->convert()PNG, JPEG, or WebP previewLibreDWG dwg2dxf, LibreOffice 7.4+ soffice, ImageMagick 7 magick

Only image previews require LibreOffice and ImageMagick.

LibreDWG ​

For installation, follow the official LibreDWG repository. Use a maintained, security-patched build that provides the command required by your operation.

Check the version and available options for the commands you use.

bash
dwgbmp --version
dwg2dxf --version
dwgread --version
dwgread --help
dwglayers --version
dwglayers --help

The dwgread help must list -O, --format, and -o, with JSON as a distinct output format. Check dwglayers --help for --flags and, if you use onlyOn(), --on.

If they are not on PATH, set their absolute paths:

dotenv
LIBREDWG_DWGBMP=/absolute/path/to/dwgbmp
LIBREDWG_DWG2DXF=/absolute/path/to/dwg2dxf
LIBREDWG_DWGREAD=/absolute/path/to/dwgread
LIBREDWG_DWGLAYERS=/absolute/path/to/dwglayers

Confirm which security fixes your build includes. A version string such as 0.14 omits the patch level.

LibreOffice ​

toImage() requires LibreOffice 7.4 or later for WebP export support.

Ubuntu and Debian ​

bash
sudo apt update
sudo apt install libreoffice
soffice --version

Confirm that the installed version is 7.4 or later.

RHEL and Fedora ​

First check whether your enabled repositories provide LibreOffice 7.4 or later. If they do, install the distribution package and verify it:

bash
sudo dnf install libreoffice
soffice --version

RHEL installations do not all expose the same package set. If that command is unavailable, download the Red Hat-family RPM archive from the official LibreOffice download page, extract it, install the RPMs from its RPMS directory, and configure the resulting soffice absolute path.

Windows ​

Install LibreOffice from the official download page. Point the package to the console launcher, normally:

dotenv
DWG_CONVERTER_LIBREOFFICE="C:/Program Files/LibreOffice/program/soffice.com"

The GUI launcher soffice.exe can report success without producing a file. Use a short absolute path for temporary_directory to avoid Windows path-length failures.

ImageMagick ​

toImage() runs the ImageMagick 7 magick command directly. You can leave PHP's ext-imagick uninstalled.

Ubuntu and Debian ​

Check your distribution's package version before installing. Ubuntu 24.04's imagemagick package provides ImageMagick 6, so sudo apt install imagemagick there does not provide the required ImageMagick 7 magick command.

When your repository provides ImageMagick 7, install it and verify the result:

bash
sudo apt install imagemagick
magick --version

Otherwise use the ImageMagick 7 AppImage from the official download page or follow the official source installation guide. Configure the downloaded or installed executable's absolute path if it is not on PATH.

RHEL and Fedora ​

Likewise, verify the repository's major version before relying on its package:

bash
sudo dnf install ImageMagick
magick --version

If the repository installs ImageMagick 6 or does not provide magick, use the official ImageMagick 7 AppImage or source installation linked above.

Windows ​

Use the official ImageMagick installer, then verify magick.exe:

powershell
magick --version

If it is not on PATH, set:

dotenv
DWG_CONVERTER_IMAGEMAGICK="C:/Program Files/ImageMagick-7.x.x-Q16-HDRI/magick.exe"

In every environment, magick --version must report ImageMagick 7. Review ImageMagick's security policy before processing untrusted files.

Last updated:

Released under the MIT License.