Load custom fonts

GroupDocs.Comparison allows you to compare documents whose content has non-standard fonts.

The following are the steps to connect custom fonts and compare documents:

  • Instantiate LoadOptions object and provide a list of directories for custom fonts;
  • Instantiate Comparer object with source document path or stream and LoadOptions object created at previous step;
  • Call add method and specify target document path or stream;
  • Call comparer method.

The following code sample shows how to connect custom fonts and compare documents.

// Instantiate the LoadOptions object and create a list of custom font directories.
LoadOptions loadOptions = new LoadOptions();
loadOptions.getFontDirectories().add("./fontPath/");
 
try (Comparer comparer = new Comparer("source.docx", loadOptions)) {
    comparer.add("target.docx");
    final Path resultPath = comparer.compare("result.docx");
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured Java library we provide simple, but powerful free Apps. You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSGand other documents with free to use online GroupDocs Comparison App.