How to set background color when converting CAD Drawings
When converting CAD drawings with GroupDocs.Viewer there is no background color set by default but we proved an option that enables you to set any background color.
Setting background color when converting CAD Drawings
Let’s check how does output looks when converting sample CAD drawing with GroupDocs.Viewer for Java.
And as you can see the background color of the output image below is white.
Now, lets set background color and convert CAD drawing one more time.
The following code snippet shows how to set background color.
Viewer viewer = new Viewer("input.dwg")) PngViewOptions options = new PngViewOptions(pageFilePathFormat); options.getCadOptions().setBackgroundColor(Color.BLUE); viewer.view(options); viewer.close();
And here is output image with blue background color:
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.