How to view DWF file layers
Design Web Format File (.dwf) consists of various user layers. Layers represent various parts of the entire drawing, for example, this drawing describes a plan of a building and it’s parts like stairs, walls, doors located in different layers.
Let’s take a sample DWF described above and then we’ll process with GroupDocs.Viewer and compare results.
By default GroupDocs.Viewer renders all layers:
How to view only specific layers
Let’s view only “Doors”, “Stairs”, “Walls” layers, to do that use following code,
Viewer viewer = new Viewer("sample.dwf"); PngViewOptions viewOptions = new PngViewOptions(); viewOptions.getCadOptions().getLayers().add(new Layer("Stairs")); viewOptions.getCadOptions().getLayers().add(new Layer("Walls")); viewOptions.getCadOptions().getLayers().add(new Layer("Doors")); viewer.view(viewOptions); viewer.close();
Now GroupDocs.Viewer will render only these layers:
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Viewer for Java examples, plugins, and showcase
- Document Viewer for .NET App WebForms UI Modern Example
- Document Viewer for Java App Dropwizard UI Modern Example
- Document Viewer for Java Spring UI Example
- GroupDocs.Viewer for .NET samples, plugins and showcase
- Document Viewer for .NET MVC UI Example
Free Online App
Along with full-featured Java library we provide simple but powerful free Apps. You are welcome to view Word, PDF, Excel, PowerPoint documents with free to use online GroupDocs Viewer App.