On this page
Sometimes there is a need to compare two Pdf, Word or Excel documents as fast, as possible, without installing lots of soft. In case you have Docker installed, the easiest way is to use it together with GroupDocs.Comparison API
To provide our clients more facilities, we published different configurations of Comparison samples. You can choose, which fits you best for your needs. To find all of them and get the latest version, please, visit our Docker Hub page
Here are just a few of configurations:
groupdocs/comparison:<VERSION>-java-openjdk8-bullseye-spring- based on OpenJDK 8 and Debian Bullseye
groupdocs/comparison:<VERSION>-java-openjdk11-bullseye-spring- based on OpenJDK 11 and Debian Bullseye
groupdocs/comparison:<VERSION>-java-openjdk18-bullseye-spring- based on OpenJDK 18 and Debian Bullseye
groupdocs/comparison:<VERSION>-java-openjdk8-bullseye-dropwizard- based on OpenJDK 8 and Debian Bullseye
groupdocs/comparison:<VERSION>-java-openjdk11-bullseye-dropwizard- based on OpenJDK 11 and Debian Bullseye
groupdocs/comparison:<VERSION>-java-openjdk18-bullseye-dropwizard- based on OpenJDK 18 and Debian Bullseye
<VERSION> should be replaced with version of Comparison you want to use.
Note: we are going to add new configurations the nearest future. Some of them are already in work, for example, using Ktor and Micronaut. Feel free to check actual configurations on the Docker Hub page
There are no any requirements to use GroupDocs.Comparer API. All you need is to have Docker installed, Web browser and Internet connection.
The easiest way to run GroupDocs.Comparison application is to use command line. Moreover, with this command you can run the application on any OS, as Windows, Linux or Mac.
Here is command to run the comparer:
That is all. Just wait while Docker download and run the application. To access comparer interface open http://localhost:8080/comparison/ in favourite browser
With the UI you can choose any two documents which are in the list of supported file formats and compare them. It is possible to upload documents from local PC as well as by URL. There are available two small sample documents by default, you can use them to check that everything works correctly. Accessing the container through terminal, you can find application files by path
/home/groupdocs/app/. There are also default
Portainer is a platform that provides web based UI for Docker. You can read how to install it on official Portainer website.
To run GroupDocs.Comparison application follow next steps:
- Open Portainer interface
Containerson the left of the screen
Imagefield (actual version as well as other available configurations you can find on our Docker Hub page)
Manual network port publishingand click
publish a new network portnear it
hosttext field and
containertext field (
hostis the port that you will use to access comparer in web browser. You can past
80as host port, in this way the application will be available in web browser without entering any port - http://localhost/comparison/)
- Click button
Deploy the container
- Wait about a minute while it is deploying
- To access comparer interface open http://localhost:8080/comparison/ in favourite web browser
At the moment there is no way to deploy container using Docker Desktop. Nevertheless, you can still manage containers which are already run. For example, run, stop, restart, show logs, access container terminal and so on.
GroupDocs.Comparison for Java provides lots of options to configure comparison process. Generating summary page, configuring style of the result document (text and highlighting colors, font weights, underlining and so on), getting text of each change and it’s coordinates in the document, configuring sensitivity of comparison, accepting/rejecting changes and much more. As for sample applications, that are available on our Docker Hub page, there are just minimum options to give you an opportunity to familiarize with basic comparison functionality. All those samples are free and available on our GitHub page. Feel free to modify and use them.
Nevertheless, there are a few options which you can change to configure Comparison sample running it with Docker. You can use some of predefined environment variables. As an example, if you want to disable uploading, pass environment variable
UPLOAD_ON with value
false in command that runs container. In this way the command will be like:
There are next predefined variables:
LIC_PATH- path to directory with license file
FILES_DIR- path to the directory with uploaded files
RESULT_DIR- path to the directory with result files
DOWNLOAD_ON- enables/disables download button in Comparison application UI
UPLOAD_ON- enables/disables uploading files (the upload button is on the left of the open document dialog)
BROWSE_ON- enables/disables document browse dialog
PRINT_ON- enables/disables button to print documents
RIGHTCLICK_ON- enables/disables right mouse click
HOST_ADDRESS- host name or ip for server instance
Note: Keep in mind,
RESULT_DIR paths are point to the folders inside Docker container
You may need to save files between application runs. To do it you should use Docker’s volumes, for example: add parameter
-v groupdocs_comparison_volume:/home/groupdocs/app/MyDocumentSamples to create new volume and pass
/home/groupdocs/app/MyDocumentSamples as a value of environment variable
FILES_DIR. In this way command will be like:
-v groupdocs_comparison_volume:/home/groupdocs/app/MyDocumentSamplesconfigures Docker to create new volume with name
groupdocs_comparison_volumeand to bind it into container as a directory
/home/groupdocs/app/MyDocumentSamples. In this way, any access to
MyDocumentSamplesinside the container will actually make changes inside the volume. Stopping container that was run with an option
--rmor manual deleting the container, volume and files inside it will not be deleted. It is easy to run new container attaching the volume, to access files again. Here is a little details about the command:
--env FILES_DIR=/home/groupdocs/app/MyDocumentSamplesconfigures Comparison application to use
/home/groupdocs/app/MyDocumentSamplesdirectory inside Docker container as a folder to store files. It can be changed to any other path, physically this directory does not exist in Docker image
groupdocs_comparison_volume is just a name of the volume. It can be used for deleting the volume. You can easily change it.
You can get a free temporary license in order to use the API without the evaluation limitations.
In this article was described the easiest way to run GroupDocs.Comparison samples using Docker. There are different configurations of comparison applications are available on our Docker Hub page so that you can choose the best one for your needs. All these samples are available on GitHub page, so you can modify and use them as a core of your own application for comparing photos, code files, PowerPoint, Excel, Word and other supported file formats. Now it is easy to build your own comparer application or use comparison features inside already exist Java applications with GroupDocs.Comparison API.
- How to compare files in Java or Kotlin
- How to compare images using Java or Kotlin
- How to compare Text, Word or PDF in Java or Kotlin
- How to compare two or more files in Java or Kotlin
- How to compare any files using Compose Desktop
- How to run Dropwizard Comparison sample as Docker container
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.