27

I'm looking for a utility or a program for Ubuntu, and possibly even for Windows that is able to convert a CAD file format .DWG to PDF.

My need is to provide a preview of CAD files, and I thought that the easiest way is to convert them into PDF format, but I'm open to suggestions, even if there is only the possibility to convert them to JPG image file type or PNG would be fine.

What interests me is only to find some solution, no matter if it is commercial or free

1

8 Answers 8

29

You can use QCAD, an open source AutoCAD replacement or the community fork LibreCAD made to work using the newer Qt4 framework. You can install LibreCAD from the Ubuntu Software Center. Using one of these two programs you import DWG files, edit the drawing and export it to PDF.

LibreCAD screenshot

QCad offered a command line tool to convert DWG to PDF directly - I'm guessing it's also available in LibreCAD.

./dwg2pdf.sh drawing.dwg
5
  • Many thanks @kermit666, this is particularly useful to me, in fact my specific interest is in finding a tool that can be invoked from the command line and that simply performs the conversion. Jan 25, 2014 at 18:13
  • np. Yes, I also like command-line access to such tasks :)
    – metakermit
    Jan 26, 2014 at 14:07
  • 4
    LibreCad don't give me a Import DWG option, but qCad opens it by default, thanks Apr 8, 2015 at 19:01
  • At the time of writing, importing DWG files is available on QCAD professional only: qcad.org/en/documentation/features Mar 2, 2022 at 22:58
  • There is no such command-line tool in LibreCAD.
    – jarno
    Oct 29, 2022 at 9:35
3

I used FreeCad.

sudo apt install freecad

If you are using Ubuntu 18.04, you could get the error No module named WebGui. In that case install it from the another repository as follows.

sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt-get update

Also, you need to install a third-party plugin ODA File Converter from https://www.opendesign.com/guestfiles/oda_file_converter to support import of DWG formats.

And set the path to the converter executable manually. open Edit → Preferences → Import-Export → DWG and fill "Path to Teigha File Converter" appropriately.

After installing the .deb package on Ubuntu, the executable's path is /usr/bin/ODAFileConverter. Looking at the extracted RPM file, it seems to be installed under /usr/local/bin/ODAFileConverter.

2

Best linux-native solution for dwg should be TeighaViewer. Teigha technologies are used by hundreds of companies around the world. Teigha is for dwg what LibreOffice is for office files (doc, xls, etc). Teigha is basically a Design Alliance, a common effort around the world to break the dictatorship of Adsk's dwg. Bricscad, DraftSight, Ares Commander, CorelCAD, Intellicad and many others are members of teigha.

Inkscape can also open .dwg files. But it doesn't always read them right (display errors and scale errors), depending on what app generated the dwg file. Inkscape deals better with .dxf files, because dxfs can't contain advanced entities, just basic entities like lines, arcs, splines, points and dimensions.

2
  • 1
    I have installed Teigha Viewer in many Ubuntus, and it always crashed when trying to open any DWG file. Do you have any advice to make it work?
    – chronos00
    Mar 22, 2018 at 0:06
  • 1
    I created the following question to try to solve the problem: askubuntu.com/questions/1018121/…
    – chronos00
    Mar 22, 2018 at 2:03
1

Lx-viewer do the job since its pretty easy to use and offers what you looking for, you should give it a try enter image description here for more info check this link

1

Qcad works, of course you have to pay for it. Varicad was a last resource but it crashes reading new files (autocad 2017).Same with Teighaviewer.Lx-viewer do es not exist.

1

DWGsee

is a windows only application to open and view DWG files. It also offers some limited modification capabilities, as described here

Since quite recently, DWGsee started working quite nicely with wine, allowing us to open, print and plot DWGs in Linux.

Steps to install DWGsee in Ubuntu/Debian:

TL;DR

Install wine. Configure it for windows 10 emulation. Run DWGsee installer and complete installation. Done.

Step by step:

  1. Download DWGsee from their site
  2. Install wine:
    • open a terminal and type
    • sudo apt install wine
  3. configure wine:
    • open a terminal and type
    • winecfg
    • this will open wine configurations
    • select "windows 10" from the drop down menu
    • click "ok"
  4. run DWGsee installer with wine:
    • open a terminal and type
    • cd Downloads
    • wine dwgseepro2020.exe
    • follow the installer/s steps, until finished
  5. All done. You can now open DWGsee from the aplication menu
  6. Additionaly you can set DWG files to open automatically with DWGsee
    • right click on any DWG file
    • click "Open with other application"
    • click "view all applications"
    • look for "DWGSee MFC Application", and click on it. This will open DWGSee for that file.
    • To make the configuration stick for all dwg files, right click again on the file, and this time click "properties", and then the tab "open with"
    • select "DWGSee MFC Application", and that's it.
0

I used in past Draftsight to convert dwg to PDF

Drafsight its a complete free CAD program that has a export to PDF function. Cross platform but not foss and free with on-line activation for Linux. I didn't used it for a time now but back in time was an amazing piece of software. Consider to read this guide how to install it.

More dwg viewers and software recommendations you can find here on Ask Ubuntu by following software that can view dwg files link

-1

Try bricscad, is the best software out there for linux, it has the same features as autocad and more, its much better and low resources.

https://www.bricsys.com

1
  • 4
    Looks great but for the sake of full disclosure, you should add that this is not FOSS & that it costs over $1000 USD (cheapest option).
    – arielf
    Feb 8, 2018 at 21:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .