/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new CCFFilter();
pdfFilter.setApplied(true);
PDFDictionary dict = new PDFDictionary();
dict.put("Columns", this.image.getSize().getWidthPx());
int compression = getImage().getCompression();
switch (compression) {
case TIFFImage.COMP_FAX_G3_1D :
dict.put("K", 0);
break;
case TIFFImage.COMP_FAX_G3_2D :
dict.put("K", 1);
break;
case TIFFImage.COMP_FAX_G4_2D :
dict.put("K", -1);
break;
default:
throw new IllegalStateException("Invalid compression scheme: " + compression);
}
((CCFFilter)pdfFilter).setDecodeParms(dict);