Render & View DWG In Java

Native and high performance DWG file viewer API for Java, J2EE and J2SE based applications, supporting a wide range of additional features to customize the appearance of the output document format.

Download Free Trial

About GroupDocs.Viewer for Java API

Enable your Java applications to display over 170+ file formats in HTML, PDF or image modes using GroupDocs.Viewer for Java APIs without any additional software installed; such as Microsoft Office, Apache Open Office, Adobe Acrobat Reader etc. Developers can easily view all popular images and document types including Microsoft Office, OpenDocument, HTML, PDF, Archive, Diagrams, Photoshop, AutoCAD and programming language formats inside the Java applications with fast and highest quality rendering.

Steps to Render DWG file in Java

With GroupDocs.Viewer you can render DWG to HTML, JPEG, PNG or PDF in a few steps.

  • Add GroupDocs.Viewer for Java as a dependency to your project.
  • Create an instance of Viewer class and load the DWG file with full path.
  • Set options to render DWG file into HTML, PNG, JPEG or PDF format.
  • Render file and check output in the current directory.

System Requirements

GroupDocs.Viewer for Java APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environments: NetBeans, IntelliJ IDEA, Eclipse etc.
  • Frameworks: J2SE 8.0 (1.8) or above (for example Java 17)

    // Set up input DWG file
    String filePath = "input.dwg";

    // Instantiate Viewer
    try (Viewer viewer = new Viewer(filePath))
    	// Set view options 
    	HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
    	// Render DWG file to HTML with embedded resources

DWG Viewer Live Demo

View DWG file right now by visiting GroupDocs.Viewer Online Apps website.

No need to download API

No need to write any code

Just upload the source file

Scroll down or use the menu to navigate between pages

Other File Formats Rendering & Viewing using Java

Multi-format documents and images viewer API for Java. View some of the popular file formats below without any external viewers.

Render DOCX

Microsoft Word Open XML Document

Render CDR

CorelDRAW File

Render PPTX

PowerPoint Open XML Presentation

Render XLSX

Microsoft Excel Open XML Spreadsheet

Render XML

XML File

Render PSD

Adobe Photoshop Document

Render Adobe Illustrator file

Adobe Illustrator Artwork

Render DOC

Microsoft Word Document

Render TXT

Plain Text File

Render DXF

Drawing Exchange Format File

Render VCF

vCard File

Render SVG

Scalable Vector Graphic

Render HTML

Hypertext Markup Language File

Render PDF

Portable Document Format File

Render JPEG

JPEG Image

Render PNG

Portable Network Graphic

Render EML

E-Mail Message

Render RTF

Rich Text Format File

Render ODT

OpenDocument Text Document

Render CSV

Comma-Separated Values File

Back to top