de·caff Viewer

The de·caff Viewer version 3.x is a Java based program for viewing AutoCAD® DWG, DXF and SHX files.

It can be used on any computer with a Java Runtime Environment installed. Usage is free, see License for more info.

DXF, DWG and SHX are formats created by AutoDesk, Inc. for their AutoCAD® programs family.

  • DWG is the native file format for Autodesk’s AutoCAD® software and is a trademark of Autodesk, Inc.
  • DXF (Data eXchange format) was designed for simplifying exchange with other CAD programs, although nowadays it does no longer fulfill this promise.
  • SHX (compiled shapes) is an old font format still used by AutoCAD® related software.

Download

Current version is 3.09.03 from Nov 18, 2017.

Click here to download caffviewer.jar

Installation

To run the viewer you’ll need a Java Runtime Environment installed. Minimum required version is 1.7.

On Windows you can put the file caffviewer.jar anywhere you want and double-click it to start it.

On other operation systems you might also be able to double-click, otherwise you can use the following command line to start it:

java -jar caffviewer.jar

To improve the memory available for the program you should add a parameter like

java -mx3g -jar caffviewer.jar

This will start the viewer allowing it to use a maximum of 3GByte of memory, which is a good value for a machine with 4GByte installed. It will only work with a 64bit Java installation.

If you like you can append DXF or DWG files to the given command line. These will be immediately loaded.

Recognizing Memory Problems

There is a memory usage indicator in the status bar which shows you how much memory the viewer has allocated and how much of it it is using. If this indicator gets dark red the viewer’s memory is nearly exhausted which will slow down performance dramatically.

Getting an error box displaying “java.lang.OutOfMemory” is the fatal sign. There’s not enough memory available for the operation you are currently running (probably loading a file).

If you have several files open you can close some of them to free memory. The newly freed memory does not show directly in the memory indicator, but it will after the next garbage collection is run. Garbage collection is done automatically so you don’t have to care, but you can enforce one if you click on the memory indicator.

Allowing for More Memory

Basically to be able to use all your machine’s memory you should use a Java 64bit installation on a 64bit operation system. With 32bit Java you’ll always be restricted to some 1.5 GBytes.

Switch On Automatic Restart

In the Miscellaneous tab in the Settings dialog (found in the Options menu) there is a Restart the viewer with improved memory settings? option. If you enable this setting the viewer will try to restart itself with improved memory settings. Effectively it is started twice this way, but modern Java handles this very well, so you’ll hardly notice it.

Use a Script to Start The Viewer

This works well to give one program (e.g. the viewer) more memory. Basically just create a script which calls

java -mx1400m -jar caffviewer.jar 

When you call this script it will start the viewer with 1400MBytes of memory, which is a good value for 32bit-Java installations on a machine with at least 2GByte of memory. You can also use a g instead of a m to indicate GBytes, so with a 64bit-Java and 8GBytes of physical memory

java -mx6g -jar caffviewer.jar

is a good start.

You can find out whether the viewer is running on a 32bit or 64bit Java by checking the first row of the Java tab in the About dialog.

Allow All Java Programs To Use More Memory

The Java Control Panel (JCP) which comes which each Java installation allows to generally set parameters for all Java applications, including the maximum of memory they are allowed to use. In Windows you’ll find it in the Settings, on other operation systems you might have to search for a program called ControlPanel.

Start it and switch to the Java tab. Click the View… button. This will open a dialog titled Java Runtime Environment Settings. Here you can add Runtime Parameters for each Java version installed on your system. Generally some 75% of yxour physical memory is a good value, but for 32bit Java there is an upper limit, so you should never exceed 1400MB. As above the upper memory level is set with the switch -mx directly followed by the amount of memory, which you can postfix with either m (MBytes) or g (GBytes). So for a 32bit Java on a machine with at least 2GByte of physical memory insert the following into the Runtime Parameters column for each Java installed on your machine

-mx1400m

For a 64bit Java and 8GByte of physical RAM you can use

-mx6g

You can find out whether the viewer is running on a 32bit or 64bit Java by checking the first row of the Java tab in the About dialog.

(Java) Security Issues

You may have heard about Java being unsecure in the press. This is true for Java running inside your browser like Applets or Java Web Start (JWS). In that case Java tries to shield your computer from harm, but it had problems fulfilling that promise to 100% in the past. So if you don’t need to run Applets or JWS programs you definitely should disable Java in your browser.

The de·caff Viewer is like any program you run locally on your machine: it may do anything you can do. As with any program you download from the internet you’ll have to trust its provider. There is nothing much else shielding you from harm, and things you get for free should raise your caution.

I make my living as a freelancing programmer selling my time and also licenses for libraries and source code to other companies. The idea behind the viewer you can download here for free is that it is a good tool to show what I can provide.

Applets

At the moment there is no applet version of the viewer like my old DXF Viewer provides. The simple reason is that I consider Applets a doomed technology.

If there is any interest let me know if you consider otherwise. But be prepared that this will not come for free.

License

The viewer is not Open Source, but the usage of the viewer is free of any charge. You may download it and use it at your own risk. Although doing my best to make it a useful tool there is no guarantee for this.

3rd Party Code

The viewer uses a few Open Source libraries. They run under the following licenses.

Apache 2.0 License

For unpacking files packed with bzip2 code from the Apache Ant project extracted by Kohsuke Kawaguchi is used. For displaying WMF (Windows Meta File) data code extracted from the Apache Batik project is used. Both are provided under the Apache 2.0 License. Thanks a lot!

Public Domain Code

For displaying files dragged on the viewer FileDrop by Robert Harder is used. It’s in the public domain. Thank you, Robert!

Others

For displaying balloon tool tips the BalloonTip library by Bernhard Pauler and Tim Molderez is used. It is provided under the following license:

Copyright © 2011 Bernhard Pauler, Tim Molderez
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the Balloon tip Developer Team nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE BALLOON TIP DEVELOPER TEAM BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Thank you, Bernhard and Tim!

Source Code and Libraries

If you are a company interested in supporting DXF and DWG in your won Java application you can license various libraries and even the complete source code of the viewer.

See Licensing Information for more.

Automatic Updates

The viewer does not automatically check for updates, but you can enable this in its settings (Options > Settings > Automatic Update). If you enable automatic updates, the viewer will on each start download a small file from this server which contains current version information. Depending on the settings you chose it will either inform you about new versions or download them silently.

Supported AutoCAD® Features

There are various undocumented features in AutoCAD®, so full support is nearly impossible. The viewer does its best, and it is constantly improving.

Format Versions

  • Supports textual and binary DXF format from the version written by AutoCAD® R7 up to 2018.

  • Supports DWG from the version written by AutoCAD® R13 up to 2018.

  • Supports SHX (binary shape files) in all known formats.

Call for Test Data

AutoCAD 2018 was released in March 2017. Sample files in this in other formats are very welcome for testing. AutoCAD has a 35 year history and its formats are very complex with a lot of quirks, so the more test data the better.

Entity Types

Entities are the drawable items in AutoCAD® like lines or arcs.

Entity Supported? Since Comments
3DFACE yes R7
3DSOLID NO R13 One of the encrypted and undocumented ACIS based entities. See ACIS Based Entities comment below.
ACAD_PROXY_ENTITY NO R13 Used to support entities from newer versions. Not supported yet, but on the todo list.
ACIDBLOCKREFERENCE yes R13? Inserted by the Inventor package, but similar enough to INSERT to be supported.
ARC yes *
ATTDEF/ATTRIB yes * Originally single line text (like TEXT), but newer versions also allow multi-line (like MTEXT).
BODY NO R13 One of the encrypted and undocumented ACIS based entities. See ACIS Based Entities comment below.
BLOCK yes R7 External references (XREF) are not yet supported, but on the todo list.
CIRCLE yes *
DIMENSION yes R7 Rendering just uses the redundant dimension BLOCK.
ELLIPSE yes R13
HATCH yes R13
HELIX NO 2007 Not yet supported due to lack of test data, seems to be rarely used.
IMAGE yes R13 Inserts an external image file, so file has to be available and understood by Java.
INSERT yes R7
LEADER yes R13
LIGHT NO 2007 Viewer currently just renders wireframe, so there’s no lighting.
LINE yes *
LWPOLYLINE yes R13
MESH yes 2013
MULTILEADER yes 2007 Complex entity, test data is welcome!
MLINE yes R13
MTEXT yes R13 Fonts need to be available for correct rendering.
OLEFRAME/OLE2FRAME yes R13 Tries to extract the preview image and render that.
POINT yes *
POLYLINE/VERTEX yes R5
RAY yes R13 Line with infinite extension in one direction.
REGION yes R13 One of the encrypted and undocumented ACIS based entities. See ACIS Based Entities comment below.
SECTIONOBJECT NO 2007 Not yet supported due to lack of test data, seems to be rarely used.
SHAPE yes * The accessed shape file (.SHX) has to be accessible.
SOLID yes *
SPLINE yes *
SUN NO * Viewer currently just renders wireframe, so there’s no lighting.
SURFACE NO 2007 One of the encrypted and undocumented ACIS based entities. See ACIS Based Entities comment below.
TABLE yes 2004 Rendering just uses the redundant table BLOCK.
TEXT yes * Fonts need to be available for correct rendering.
TOLERANCE yes R13 Fonts need to be available for correct rendering.
TRACE yes *
UNDERLAY NO 2004 Inserts just another format like PDF, DWF or DGN.
VIEWPORT yes R10 Only rectangular.
WIPEOUT yes R13
XLINE yes R13 Line with infinite extension in both directions.

ACIS Based Entities

Starting with R13 AutoCAD® uses a 3rd party library for specialized 3D operations. The entities which wrap this library are

  • 3DSOLID
  • BODY
  • REGION
  • SURFACE

These entities are stored in a completely different format, which is even encrypted. The format itself is quite complex, and some of its features require complex mathematical operations, which makes complete support difficult. Therefore at the moment only REGION is supported, because it uses only the subset of the whole format which is necessary for 2D objects.

Properties

Property Supported? Comments
Annotation Scales NO Displays only parts of the model which fulfill a given scaling criteria.
Color yes Support includes all possible color formats.
Invisible Entities yes Individual entity invisible can be globally switched off.
Layer yes
Line Type yes Includes extended line types with texts and shapes.
Line Width yes This is a varying width possible for LWPOLYLINE and 2D POLYLINE entities.
Line Weight yes Line Weight is a physical line width for layouts, and a view width independent from zoom factor for models.
Material NO Viewer currently just renders wireframe, so there’s no use for materials.
Reordering yes Reordering means that entities are drawn in an order different from the one in which they are defined in the file.
Spatial Filtering NO Spatial filtering is used to clip away parts of the model, although it is often just used to draw a frame without any actual clipping.
Views yes Views in DXF come in various flavors: VIEWs, VPORTs, VIEWPORTs, LAYOUTs and Paper Space. All of these are supported, but currently only with rectangular clipping.
External References yes Embedding of other DWGs in a drawing.

History

The de·caff Viewer is the successor of my de·caff DXF Viewer, for which implementation started in 1996. So it celebrated its 20th birthday in 2016. Time for a good program to retire, and make place for something new.

Versions

Version Release Date Comments
3.09.03 Sat Nov 18 18:19:26 CET 2017 Bugfix Release
  • Fixed sometimes incorrect handling of ATTRIB, ATTDEF and MTEXT entities in both DWG and DXF files written by AutoCAD 2018.
3.09.02 Mon Nov 13 18:37:28 CET 2017 Bugfix Release
  • Fixed handling of dedicted symbols: degree, plus-minus, diameter.
3.09.01 Thu Nov 9 14:40:24 CET 2017 Bugfix Release
  • Fixed handling of text with extended TTF information.
3.09.00 Mon Nov 6 19:00:52 CET 2017 Feature Release
  • Added support for AutoCAD 2018 DWG/DXF.
3.08.00 Thu Nov 2 18:10:29 CET 2017 Feature Release
  • Added support for HiDPI displays. Use Ctrl+Scrollwheel or menu to enlarge or shrink fonts and icons.
3.07.13 Fri Oct 20 08:41:17 CEST 2017 Bugfix Release
  • Fixed packaging error which removed the ability to load DWGs.
3.07.12 Thu Oct 19 16:43:30 CEST 2017 Bugfix Release
  • Fixed handling of hidden TTF access information. This will render some texts differently.
3.07.11 Fri Sep 15 16:24:57 CEST 2017 Bugfix Release
  • Fixed incorrect vertical positioning of MTEXT which includes partially empty stacked texts.
3.07.10 Sun Jul 23 19:19:16 CEST 2017 Bugfix Release
  • Fixed incorrect SHX glyph selection.
3.07.09 Sun Jul 23 17:02:20 CEST 2017 Bugfix Release
  • Fixed incorrect handling of invisible arcs in SHX glyphs.
3.07.08 Mon Jul 17 15:39:12 CEST 2017 Improvement Release
  • Improved selection of correct presentation for OLE data with multiple presentations.
3.07.07 Thu Jun 29 14:03:45 CEST 2017 Internal Improvement Release
  • This only improves handling of information of OLE objects.
3.07.06 Tue May 23 16:53:58 CEST 2017 Bugfix Release
  • Fixed zero length MLEADER leader line throwing an IllegalArgumentException.
3.07.05 Fri May 5 21:09:27 CEST 2017 Bugfix Release
  • Fixed concurrent modification exception during recursive XREF read.
  • Improved rendering of stacked text.
  • Improved rendering of selfoverlapping wide polyline.
3.07.04 Wed May 3 15:05:10 CEST 2017 Bugfix Release
  • Fixed incorrect reading of Unicode escapes under special circumstances.
  • Finetuned MTEXT 2008 round trip handling.
3.07.03 Sat Apr 29 22:13:01 CEST 2017 Bugfix Release
  • Fixed round trip text overrides for MTEXTs not used when checksum is wrong.
3.07.02 Mon Apr 24 17:49:07 CEST 2017 Bugfix Release
  • Fixed stacked MTEXT problems.
3.07.01 Tue Apr 11 16:05:10 CEST 2017 Bugfix Release
  • Fixed broken picking of HATCH entities.
3.07.00 Mon Apr 10 20:43:51 CEST 2017 Feature Release
  • Added the possibility to make invisible entities visible.
3.06.11 Fri Apr 7 18:26:29 CEST 2017 Bugfix Release
  • Fixed sometimes incorrectly scaled layout extent.
3.06.10 Thu Apr 6 17:38:30 CEST 2017 Bugfix Release
  • Improved TTF handling on Unix when there is no font server.
3.06.09 Wed Apr 5 14:33:44 CEST 2017 Internal Improvements Release
  • This only improves internal items like logging and assertions.
3.06.08 Mon Mar 20 17:58:28 CET 2017 Bugfix Release
  • Fixed lineweight missing under special circumstances.
  • Fixed NPE for broken newer DXF missing CLASSES section.
  • Fixed IndexOutOfBoundsException during VIEWPORT read.
3.06.07 Fri Mar 17 16:34:44 CET 2017 Bugfix Release
  • Added handling of line weight for export filters not yet supporting it.
3.06.06 Tue Mar 14 14:41:25 CET 2017 Feature Release
  • Added workaround allowing to read broken GERBER DXF files.
3.06.05 Fri Feb 17 11:15:15 CET 2017 Bugfix Release
  • Added codepage setting for ATIR SHX font.
3.06.04 Fri Jan 20 15:31:31 CET 2017 Bugfix Release
  • Fixed broken display of SHX files.
3.06.03 Fri Dec 16 17:08:48 CET 2016 Bugfix Release
  • Fixed sometime incorrect clipping of IMAGE entities.
  • Improved loading of external data.
3.06.02 Wed Nov 16 14:29:02 CET 2016 Bugfix Release
  • Fixed NPE when showing structure of ACAD_TABLE read from newer DWG versions.
  • Fixed highlighting of entities when selected in structure panel.
3.06.01 Fri Nov 11 15:39:21 CET 2016 Bugfix Release
  • Fixed incorrect handling of closed periodic splines with custom parametrization.
  • Fixed handling of recursively packed files.
3.06.00 Thu Nov 10 13:54:17 CET 2016 Feature Release
  • Introduces the first step in repairing broken drawings. Currently only recursively nested blocks will be fixed.
3.05.06 Mon Nov 7 16:12:37 CET 2016 Bugfix Release
  • Fixed GUI hanging after empty file was read.
3.05.05 Tue Nov 1 14:38:19 CET 2016 Bugfix Release
  • Zooming to entities from structure panel did not work in all cases.
  • Reduced possibly unhandable large data when displaying DXF output in properties.
3.05.04 Sun Oct 30 16:03:46 CET 2016 Bugfix Release
  • Improved coloring of MLINE elements.
3.05.03 Fri Oct 28 14:03:18 CEST 2016 Bugfix Release
  • Fixed another font resolve problem.
3.05.02 Thu Oct 27 22:36:19 CEST 2016 Maintenance Release
  • Fixes various minor bugs.
  • Changes stroke properties for lines with weight.
3.05.01 Tue Oct 11 14:47:42 CEST 2016 Bugfix Release
  • Fixes broken layout views sometimes appearing in Views tab.
3.05.00 Mon Oct 10 20:25:48 CEST 2016 Feature Release
  • Adds support for proxy graphics. Proxy graphics is graphics attached to entities which might be use for display if the type of the entity is unknown.
  • Also improves font lookup in some cases.
3.04.02 Fri Sep 30 11:21:35 CEST 2016 Feature Release
  • Improved display of spline-based polylines.
  • Sorting of objects in structure display is no by handle
3.04.01 Wed Sep 14 12:54:13 CEST 2016 Bugfix Release
  • Fixed lineweight handling with TTF texts.
  • Improved OLE handling.
3.04.00 Tue Aug 30 12:31:46 CEST 2016 Feature Release
  • Added support for loading external references (XREF).
  • Fixed exception when anonymous block is incorrectly named.
3.03.06 Sun Aug 14 15:56:45 CEST 2016 Bugfix Release
  • Fixed usage of circle segments setting introduiced in 3.03.05.
3.03.05 Fri Aug 12 16:32:04 CEST 2016 Bugfix Release
  • Fixed broken VIEWPORTs in pre-2000 DWGs.
  • Fixed incorrect handling of ACIDBLOCKREFERENCEs.
  • Allowed user to set smoothness of CIRCLEs and ARCs.
3.03.04 Thu Jul 21 14:22:10 CEST 2016 Bugfix Release
  • Fixed NPE when switching off picking.
3.03.03 Wed Jul 20 12:36:54 CEST 2016 Bugfix Release
  • Improved rendering of wide polylines
  • Fixed sometimes incorrect extrusion of SHAPE.
3.03.02 Sun Jul 17 14:26:03 CEST 2016 Bugfix Release
  • Fixed codepage problem leading to error in encoding bytes.
3.03.01 Wed Jul 13 19:57:34 CEST 2016 Bugfix Release
  • Viewer now always draws outer border of filled items.
  • Fixed incorrect DXF reading of RAY/XLIINE direction.
  • Fixed shaky handling of infinities in printing and previews.
3.03.00 Mon Jul 11 17:18:55 CEST 2016 Feature Release
  • Added support for MULTILEADER entity.
  • Added support for RAY entity.
  • Added support for XLINE entity.
3.02.05 Sun Jun 26 15:37:16 CEST 2016 Bugfix Release
  • Fixed possible NullPointerException in print preview.
3.02.04 Mon Jun 20 12:11:33 CEST 2016 Bugfix Release
  • Streamlined zero border handling in print preview.
3.02.03 Sun Jun 19 18:37:04 CEST 2016 Bugfix Release
  • Fixed landscape orientation printing.
3.02.02 Sun Jun 19 16:27:10 CEST 2016 Bugfix Release
  • Fixed NullPointerException caused by multi-threaded messages.
  • Fixed possible IndexOutOfBoundsException during clipping.
3.02.01 Sat Jun 18 15:49:00 CEST 2016 Bugfix Release
  • Fixed problem with borderless printing on Windows
  • Fixed TTF sometimes not properly resolved
3.02.00 Fri Jun 17 14:41:18 CEST 2016 Feature Release
  • Added support for line weight.
  • Added borderless printing button.
3.01.03 Mon Jun 13 15:19:56 CEST 2016 Improvement Release
  • Improved line type handling to use less memory.
3.01.02 Fri Jun 10 16:08:21 CEST 2016 Bugfix Release
  • Fixed potential MTEXT color escape problem.
3.01.01 Tue May 31 15:45:33 CEST 2016 Bugfix Release
  • Automatic Update was not working yet.
3.01.00 Wed May 25 15:01:39 CEST 2016 Feature Release
  • Print preview now remembers its settings.
  • Reenabled support for dropping of URLs.
3.00.02 Tue May 24 19:32:37 CEST 2016 Bugfix Release.
  • Fixed update broken.
  • Fixed unset i18n resource.
3.00.01 Tue May 24 14:18:09 CEST 2016 Bugfix Release.
  • Fixed vertical tabs problem
  • Fixed needless preview calculation
  • Fixed potential infinite loop
3.00.00 Fri May 20 13:57:33 CEST 2016 First release.