Migration notes

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.Conversion 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-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

Why migrate?

Here are the key reasons to use the new updated API provided by GroupDocs.Conversion for Java since version 20.2:

  • The Converter class was introduced as a single entry point to manage the document conversion process to any supported file format (instead of the ConversionHander class from previous versions).
  • The overall conversion speed improved dramatically by saving each page as soon as it was converted, not when all pages list were converted.
  • Product architecture was redesigned from scratch in order to decrease memory usage (from 10% to 400% approx. depending on the document type).
  • Document conversion options were simplified for easy control over document conversion and saving processes.

How to migrate?

Here is a brief comparison of how to convert a document into PDF format using old API and new one.

Old coding style

String documentPath = "sample.docx";
String outputPath = "C:\\output\\converted.pdf";

//Instantiating the conversion handler
ConversionHandler conversionHandler = Common.getConversionHandler();

SaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setConvertFileType(PdfFileType.Pdf);
  
ConvertedDocument convertedDocumentPath = conversionHandler.convert(documentPath , saveOptions);
convertedDocumentPath.save("C:\\output\\converted.pdf");

New coding style

String documentPath = "C:\\sample.docx"; 
String outputPath = "C:\\output\\converted.pdf";
  
try(Converter converter = new Converter(documentPath))
{
    PdfConvertOptions convertOptions = new PdfConvertOptions();
    converter.convert(outputPath, convertOptions);
}

For more code examples and specific use cases please refer to our Developer Guide documentation or GitHub samples and showcases.