Use CompressionLoadOptions to specify the source archive format, provide a password, or control how deeply nested contents are processed. Pass the options through a load-options provider when constructing Converter.
Available options
Option
Description
setFormat(CompressionFileType)
Explicitly specifies the source format. Leave it unset to use format detection.
setPassword(String)
Supplies the password for a protected source archive.
setDepth(int)
Sets the recursion depth for processing nested documents. The default is 3.
isConvertOwned()
Returns true: contained documents are processed. This property is read-only.
isConvertOwner()
Returns false: the archive itself is not rendered as a document. This property is read-only.
The Java 26.10 compression file types include ZIP, RAR, 7Z, TAR, CPIO, CAB, GZ/GZIP, BZ2, LZ, LZMA, XZ, Z, ZST, ISO, and UUE. Available output formats depend on the source format. Use Getting Possible Conversions to inspect them.
Specify the source format
This example loads an ISO image explicitly and converts it to a ZIP archive. Specifying the format is useful when loading a stream or a file with an ambiguous extension.
Use the load-options password for the source archive. A password assigned to CompressionConvertOptions, where supported, controls the output archive instead.
Loading an archive and converting its contained documents to PDF is a different operation from changing the archive format. Set the nesting depth in CompressionLoadOptions and supply a separate output stream for each converted item, as shown in Convert compression files.