Document rendering solution

Render & view HTML in Java

Native and high performance HTML 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.

Steps to render HTML file in Java

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

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

// Set up input HTML file
String filePath = "input.html";

// Instantiate GroupDocs.Viewer
try (Viewer viewer = new Viewer(filePath))
    // Set view options
    HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
    // Render HTML file to HTML with embedded resources
<dependencies> <dependency> <groupId>com.groupdocs</groupId> <artifactId>groupdocs-viewer</artifactId> <version>23.7</version> </dependency> </dependencies> <repositories> <repository> <id></id> <name>GroupDocs Repository</name> <url></url> </repository> </repositories>
click to copy
More examples Documentation

About GroupDocs.Viewer for Java API

Enable your Java applications to display over 180+ 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.
Learn more
About illustration

Ready to get started?

Try GroupDocs.Viewer features for free or request a license

Render other file formats using Java

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