I use a custom JS file to convert DWG/DXF files to PNG via the command line

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
hik-IT
Junior Member
Posts: 20
Joined: Wed Jun 11, 2025 2:33 am

I use a custom JS file to convert DWG/DXF files to PNG via the command line

Post by hik-IT » Mon Jun 16, 2025 10:12 am

I use a custom JS file to convert DWG/DXF files to PNG via the command line:
qcadcmd.com -platform offscreen -no-gui -autostart scripts/dwg2png.js -input input.dwg -output output.png 2>error.log
The JS file can be loaded and executed, but the conversion to PNG did not succeed.

Additionally, how to suppress debug messages in the console output and keep only errors?

Environment
Windows10
Qcad 3.23.3 pro
Attachments
53bfe443b0e82.dwg
(333.16 KiB) Downloaded 124 times
dwg2png.js
(7.11 KiB) Downloaded 158 times

User avatar
andrew
Site Admin
Posts: 8774
Joined: Fri Mar 30, 2007 6:07 am

Re: I use a custom JS file to convert DWG/DXF files to PNG via the command line

Post by andrew » Mon Jun 16, 2025 2:31 pm

May I ask if this is AI generated code? Since much of the API is dreamed up and non-existent.

Also, are you aware of dwg2bmp which comes with every installation of QCAD Professional and converts DXF and DWG files to many bitmap formats including PNG?

Under Linux, macOS or cygwin (Windows), you can use grep to filter messages. In the standard Windows command line, there's probably no easy way.

Post Reply

Return to “QCAD Troubleshooting and Problems”