GroupDocs.Conversion for Java 23.6 Release Notes
This page contains release notes for GroupDocs.Conversion for Java 23.6
Major Features
There are 2 features in this release:
- Converting from archive formats
- Direct conversion from archive to archive (e.g. 7z to zip, tar to zip)
Full List of Issues Covering all Changes in this Release
Key | Category | Summary |
---|---|---|
CONVERSIONJAVA‑1979 | Feature | Working with archives: solution design |
CONVERSIONJAVA‑1982 | Feature | Create classes for Archive documents |
Conversion of archived files
Now you can convert the contents of archives from one format into another without prior extracting of contents. For example, the following code will convert the content of a ZIP archive to PDF format:
try (Converter converter = new Converter("sample.zip")) {
converter.convert(() -> new ByteArrayOutputStream(), (convertedStream, sourceFileName) -> {
String outputFolder = "C:\\Output";
Path path = Paths.get(outputFolder , sourceFileName + ".pdf");
if (!path.getParent().toFile().exists())
Files.createDirectory(path.getParent());
try (FileOutputStream fs = new FileOutputStream(path.toFile()); InputStream inputStream = convertedStream.toInputStream();) {
int read = 0;
byte[] buf = new byte[1024];
do {
read = inputStream.read(buf, 0, buf.length);
if (read > 0) {
fs.write(buf, 0, read);
}
} while (read > 0);
}
return null;
}, (s, fileType) -> new PdfConvertOptions());
}
Public API and backward incompatible changes
None.