How to crop a specified region from DWG/DXF and convert it to BMP via 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
dreamskyer
Newbie Member
Posts: 6
Joined: Tue Jun 10, 2025 12:10 pm

How to crop a specified region from DWG/DXF and convert it to BMP via command line?

Post by dreamskyer » Tue Jun 10, 2025 12:32 pm

Problem:How to crop a specified region from DWG/DXF and convert it to BMP via command line?

Current command:
./dwg2bmp -platform offscreen -zoom-all -width=6000 -height=6000 -window 2000000,-573237.78,3552109.93,643795.06 -flat -f B.dwg

Issue:
Cropping by coordinates to BMP does not work.

Environment
Linux Centos7
Qcad 3.23.3

Expected output:
Attachments
Expected output.png
Expected output.png (25.33 KiB) Viewed 28142 times
B.dwg
(6.3 MiB) Downloaded 302 times

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

Re: How to crop a specified region from DWG/DXF and convert it to BMP via command line?

Post by andrew » Tue Jun 10, 2025 12:48 pm

Try:
./dwg2bmp -platform offscreen -zoom-all -width=6000 -height=6000 -window=2000000,-573237.78,3552109.93,643795.06 -flat -f B.dwg

Note the = after -window.

Note that your window has a different format than your bitmap size. QCAD will center your window on the bitmap format.

Post Reply

Return to “QCAD Troubleshooting and Problems”