Load file from local disk

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Comparison MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-comparison -- dnx GroupDocs.Comparison.Mcp --yes
Folders, licensing and more →

On this page

When the source file is located on the local disk, GroupDocs.Comparison allows you to load it using the Comparer class constructor by specifying absolute or relative path. To load the target file located on the local disk, use the add() method. Specify absolute or relative path as parameter.

The following code snippet shows how to load files from local disk:

import com.groupdocs.comparison.Comparer;
import java.nio.file.Path;
// ...

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

On this page