GroupDocs.Conversion for Java 26.9 Release Notes
Major Features
There are 3+ features and bug fixes in this release:
- Introduced cooperative cancellation support for document conversion.
- Added conversions between Bzip2, Gzip, LZMA, and XZ, and conversion from Unix Z to these formats.
- Added a stable Java module name for applications using the Java module system.
Full List of Issues Covering all Changes in this Release
The following .NET issue keys identify features ported to Java. Their summaries reflect the formats implemented in this Java release.
| Key | Category | Summary |
|---|---|---|
| CONVERSIONNET-6880 | Feature | Support cooperative cancellation through cancellation tokens |
| CONVERSIONNET-7032 | Feature | Convert Bzip2, Gzip, XZ, and Unix Z to LZMA |
| CONVERSIONNET-7019 | Feature | Convert LZMA to Bzip2 and Gzip |
| CONVERSIONNET-7020 | Feature | Convert Unix Z to Bzip2 and Gzip |
| CONVERSIONNET-7030 | Feature | Convert Bzip2, Gzip, LZMA, and Unix Z to XZ |
| CONVERSIONNET-7029 | Feature | Convert XZ to Bzip2 and Gzip |
| CONVERSIONNET-7028 | Feature | Convert Gzip to Bzip2 |
| CONVERSIONNET-7021 | Feature | Convert Bzip2 to Gzip |
| CONVERSIONJAVA-3238 | Task | [Quality] Fix package verification findings in groupdocs-conversion-26.7.jar |
Public API and backward incompatible changes
Cancellation support
- Added
com.groupdocs.conversion.CancellationTokenandcom.groupdocs.conversion.CancellationTokenSource. - Added overloads of all public
Converter.convert(...)methods andConverter.convertPageByPage(...)with a finalCancellationTokenparameter. Existing overloads remain available and useCancellationToken.NONE, so existing calls do not require changes. - Added
ConversionExecutor.convert(CancellationToken).
Use CancellationTokenSource.getToken() to pass a cancellation signal to conversion, and call cancel() on that source
to request cancellation, including from another thread. A cancelled source cannot be reset.
import com.groupdocs.conversion.CancellationTokenSource;
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;
CancellationTokenSource cancellationSource = new CancellationTokenSource();
try(Converter converter = new Converter("input.docx")) {
converter.convert("converted.pdf",new PdfConvertOptions(),cancellationSource. getToken());
}
Cancellation is checked between conversion operations. An operation already running finishes before cancellation is
observed. Cancellation raises java.util.concurrent.CancellationException; output already written is not rolled back.
Passing a null token raises NullPointerException.
Compression conversion support
Use CompressionConvertOptions.setFormat(...) to select the target compression format.
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.filetypes.CompressionFileType;
import com.groupdocs.conversion.options.convert.CompressionConvertOptions;
CompressionConvertOptions options = new CompressionConvertOptions();
options.setFormat(CompressionFileType.Lzma);
try(Converter converter = new Converter("input.gz")) {
converter.convert("converted.lzma",options);
}
Supported compressed-stream sources are Bzip2 (Bz2), Gzip (Gz and Gzip), LZMA (Lzma), XZ (Xz), and Unix Z
(Z). Supported targets are Bzip2, Gzip, LZMA, and XZ, including same-format conversion.
The advertised archive conversion pairs are now restricted to conversions within ZIP, 7z, TAR, and CPIO. Applications relying on the previous advertised archive-to-compressed-stream pairs should review the available conversions before upgrading.
Java module name
The release JAR declares Automatic-Module-Name: com.groupdocs.conversion, providing a stable name for applications
using the Java module system.