How can I call dwg2pdf, dwg2bmp or dwg2svg from a PHP script running on a server?
Calling QCAD command line tools from PHP
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Calling QCAD command line tools from PHP
From a QCAD user:
Re: Calling QCAD command line tools from PHP
The QCAD command line tools can be used to convert DWG or DXF drawings to bitmap formats (BMP, JPEG, PNG, TIFF, ...), PDF or SVG. You can also develop your own QCAD command line tools to create, manipulate, analyse or convert drawings.
To install QCAD on a server, you can simply copy the .tar.gz or .zip archive to the server and extract it there or copy the extracted files to the server.
You can then call any QCAD command line tool from PHP using the PHP function exec:
For more information about QCAD command line tools, please refer to:
http://www.qcad.org/en/qcad-documentati ... line-tools
To install QCAD on a server, you can simply copy the .tar.gz or .zip archive to the server and extract it there or copy the extracted files to the server.
You can then call any QCAD command line tool from PHP using the PHP function exec:
$output = null; exec("/path/to/qcad/dwg2bmp -width=1024 -height=768 -f -o /tmp/output.png /tmp/input.dwg 2>/dev/null", $output);If your server is running Windows, you'd have to use the Windows path notation instead.
For more information about QCAD command line tools, please refer to:
http://www.qcad.org/en/qcad-documentati ... line-tools