複数ページのTIFFを単一のTIFFファイルに変換する
JDeliは、個々のTIFF画像を単一の複数ページTIFFファイルに変換することができます。
- 複数ページTIFF画像をJavaに読み込む(他のサポートされている画像も処理可能)
TiffDecoder decoder = new TiffDecoder();
BufferedImage image = decoder.read(imageData);
- 必要に応じて画像を処理 する
- Java画像を複数の画像TIFFファイルに書き出す
for (int i = 0; i <= decoder.getPageCount(); i++) {
BufferedImage image = decoder.read(i);
TiffEncoderOptions options = new TiffEncoderOptions();
//optionsインスタンスにオプションを設定 - 以下に例を示します
options.setCompressionFormat(TiffCompressionFormat.DEFLATE);
options.setXmpMetaData("xmp metadata");
//書き出し
JDeli.write(image, options, outputStreamOrFile);
}
これはTiffDecoder クラスを使用します
