Skip to content

groupdocs-comparison/GroupDocs.Comparison-for-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

186 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Document Comparison Java Library

GroupDocs.Comparison for Java is a Document Comparison API that provides the ability to detect differences between source and target files for changes at paragraph, word and character levels as well as can identify styling and formatting changes. The API supports over 50 document types from popular categories such as Microsoft Office, OpenOffice, AutoCAD, Visio, images, programming, PDF & more.

Directory Description
Demos GroupDocs.Comparison for Java Dropwizard and Spring Demo projects.
Examples Java examples and sample documents for you to get started quickly.

Important: Demo Applications Only

The projects in the Demos folder and the Docker images published as groupdocs/comparison are sample applications intended to demonstrate GroupDocs.Comparison 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, compare, 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.Comparison and all dependencies up to date

The Spring and Dropwizard demos include basic path security via PathSecurityUtils (path traversal checks, file name sanitization, HTTP/HTTPS-only upload URLs). Invalid paths return HTTP 403 (Access denied). This reduces common path-based risks but does not replace a full security review.

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.

Demos

All web demos run on http://localhost:8080/comparison/ and provide document comparison with upload, download, file tree browsing, and result preview support.

Demo Framework Language Build Version
Spring Spring Boot 2.6 Java mvn clean spring-boot:run 26.5
Dropwizard Dropwizard Java mvn clean compile exec:java 26.5
Javalin Javalin Kotlin ./gradlew run 26.5
Ktor Ktor Kotlin ./gradlew run 26.5
Micronaut Micronaut 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/comparison:latest
docker run -p 8080:8080 groupdocs/comparison: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.

Images are built and published via the Publish Docker Images GitHub Actions workflow (manual dispatch). Set repository secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN before pushing.

Compare Documents via Java

Get Started with GroupDocs.Comparison for Java

GroupDocs.Comparison for Java requires J2SE 8.0 (1.8) or above. Please install Java first if you do not have it already.

GroupDocs hosts all Java APIs on GroupDocs Artifact Repository, so simply configure your Maven project to fetch the dependencies automatically.

Compare 2 PDF Documents

try (Comparer comparer = new Comparer("source.pdf")) {
    comparer.add("target.pdf");
    comparer.compare("result.pdf");
}

Home | Product Page | Documentation | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

About

GroupDocs.Comparison for Java examples, plugins and showcase projects

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages