Skip to content

groupdocs-viewer/GroupDocs.Viewer-for-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

377 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GroupDocs.Viewer for Java - Examples and Demo Projects

GroupDocs.Viewer for Java is a document viewer API that supports over 170 document formats including Microsoft Office, OpenOffice, PDF, CAD, Photoshop, Visio, images, archives, email messages and more.

Render documents to HTML5, PDF, or image formats with high-quality output. Process documents page-by-page, all at once, or by custom page range. Customize appearance with watermarks, page rotation/reordering, and text extraction with coordinates.

Important: Demo Applications Only

The projects in the Demos folder and the Docker images published as groupdocs/viewer are sample applications intended to demonstrate GroupDocs.Viewer for Java features.

They are not production-ready services and must not be exposed to the public internet without additional hardening.

Before using a demo in any shared or production-like environment:

  • Run it on localhost or a trusted private network only
  • Do not publish Docker containers directly to the internet without authentication, a reverse proxy, and network restrictions
  • Treat file upload, browse, and download features as untrusted input — validate and sandbox file paths in your own integration
  • Add authentication, authorization, rate limiting, and logging appropriate for your security requirements
  • Keep GroupDocs.Viewer and all dependencies up to date

For production integrations, use the library (Examples, documentation) and implement your own secure document storage and API layer instead of deploying these demos as-is.

Repository Structure

Directory Description
Demos Demo projects for Spring, Dropwizard, Javalin, Ktor, Micronaut, and Compose Desktop.
Examples Java API usage examples with sample documents.

Demos

All web demos run on http://localhost:8080/viewer/ and provide document viewing with zoom, thumbnails, text search, page rotation, download/upload, and print support.

Demo Framework Language Build Version
Spring Spring Boot 2.5 Java mvn clean spring-boot:run 26.5
Dropwizard Dropwizard 1.3 Java mvn clean compile exec:java 26.5
Javalin Javalin 4.6 Kotlin ./gradlew run 26.5
Ktor Ktor Kotlin ./gradlew run 26.5
Micronaut Micronaut 3.4 Kotlin ./gradlew run 26.5
Compose Compose Desktop Kotlin gradlew run 26.5

The Compose demo is a standalone desktop application (not a web app).

Docker

Pre-built Docker images are available on Docker Hub.

docker pull groupdocs/viewer:latest
docker run -p 8080:8080 groupdocs/viewer:latest

Security notice: Docker images ship with demo defaults (e.g. upload and browse enabled, no authentication). Use them for local evaluation only. Do not expose port 8080 to untrusted networks without adding authentication, path validation, and other security controls required by your organization.

Available image tags follow the pattern {version}-java-{jdk}-bullseye-{framework}:

Tag JDK Framework
{ver}-java-openjdk8-bullseye-spring Eclipse Temurin 8 Spring
{ver}-java-openjdk11-bullseye-spring Eclipse Temurin 11 Spring
{ver}-java-openjdk18-bullseye-spring Eclipse Temurin 21 Spring
{ver}-java-openjdk8-bullseye-dropwizard Eclipse Temurin 8 Dropwizard
{ver}-java-openjdk11-bullseye-dropwizard Eclipse Temurin 11 Dropwizard
{ver}-java-openjdk18-bullseye-dropwizard Eclipse Temurin 21 Dropwizard

The latest tag points to the openjdk18-bullseye-spring variant.

The Docker Hub repository overview is generated from docs/docker-hub-overview.md when the Publish Docker Images workflow runs with Push enabled.

Getting Started

GroupDocs.Viewer for Java requires J2SE 8.0 (1.8) or above.

Add the GroupDocs repository to your Maven project:

<repository>
    <id>GroupDocs Artifact Repository</id>
    <url>https://releases.groupdocs.com/java/repo/</url>
</repository>

Then add the dependency:

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-viewer</artifactId>
    <version>26.5</version>
</dependency>

See the installation guide for details.

Code Examples

Render DOCX as Responsive HTML

Viewer viewer = new Viewer("sample.docx");
HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
viewOptions.setRenderResponsive(true);
viewer.view(viewOptions);
viewer.close();

View DOCX as Protected PDF

Viewer viewer = new Viewer("sample.docx");
Security security = new Security();
security.setDocumentOpenPassword("o123");
security.setPermissionsPassword("p123");
security.setPermissions(Permissions.ALLOW_ALL ^ Permissions.DENY_PRINTING);

PdfViewOptions viewOptions = new PdfViewOptions(filePath);
viewOptions.setSecurity(security);

viewer.view(viewOptions);
viewer.close();

Licensing

The license is not included in this repository. Without a license, GroupDocs.Viewer runs in evaluation mode. Request a temporary license at https://purchase.groupdocs.com/temporary-license.

Resources

Home | Product Page | Documentation | API Reference | Online Demo | Blog | Free Support | Temporary License

About

GroupDocs.Viewer for Java - Examples and Demo Projects

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages