GroupDocs.Conversion for Java 24.2 Release Notes

Major Features

There are 10+ features and bug fixes in this release:

  • Implemented converting pdf file to PDF/2A standard
  • Improved detecting jpeg from stream
  • Conversion from OLM
  • Implemented options to restrict external resources loading
  • Improved Presentation to XPS conversions
  • Improved WordProcessing to XPS conversions
  • Improved WordProcessing to XPS conversions
  • Improved Diagram to XPS conversions
  • Improved Email to Pdf conversions
  • Fixed margin respection when converting from Web document

Full List of Issues Covering all Changes in this Release

KeyCategorySummary
CONVERSIONNET‑6192FeatureOptions to restrict external resources loading during conversion
CONVERSIONNET‑6209EnhancementImprove Spreadsheet to XPS conversion
CONVERSIONNET‑6206EnhancementImprove WordProcessing to XPS conversion
CONVERSIONNET‑6208EnhancementImprove Presentation to XPS conversion
CONVERSIONNET‑6207EnhancementImprove Diagram to XPS conversion
CONVERSIONNET‑6211EnhancementImprove Email to PDF conversion
CONVERSIONNET‑6160FixHTML to PDF margins not applied
CONVERSIONNET-6351FixConverting pdf file to PDF/2A standard

Introduced new property PreserveDocumentStructure in WordProcessingLoadOptions class.

Usage example:

public class Main {
    public static void main(String[] args) {
        WebLoadOptions loadOptions = new WebLoadOptions();
        loadOptions.setSkipExternalResources(true);
        try (Converter converter = new Converter("sample.html", () -> loadOptions)) {
            converter.convert("converted.pdf", new PdfConvertOptions());
        }
    }
}

To skip loading most of the external resources, but still load some particular resources, use the WhitelistedResources property of the same classes. It accepts the string list containing the portions of URLs to be loaded while restricting the loading of other external resources.

The following code sample shows how to load the JPG and JPEG images and any resources from the example.com domain while restricting any other external resources:


public class Main {
    public static void main(String[] args) {
        WebLoadOptions loadOptions = new WebLoadOptions();
        loadOptions.setSkipExternalResources(true);
        loadOptions.setWhitelistedResources(Arrays.asList("jpg", "jpeg", "example.com"));
        try (Converter converter = new Converter("sample.html", () -> loadOptions)) {
            converter.convert("converted.pdf", new PdfConvertOptions());
        }
    }
}

Public API and backward incompatible changes

None