public PDCcitt(PDDocument doc,
RandomAccess raf) throws IOException {
super( new PDStream(doc),"tiff");
// super( new PDStream( doc, null, true ), "tiff" );
COSDictionary decodeParms = new COSDictionary();
COSDictionary dic = getCOSStream();
extractFromTiff(raf, getCOSStream().createFilteredStream(),decodeParms);
dic.setItem( COSName.FILTER, COSName.CCITTFAX_DECODE);
dic.setItem( COSName.SUBTYPE, COSName.IMAGE);
dic.setItem( COSName.TYPE, COSName.getPDFName( "XObject" ) );
dic.setItem( "DecodeParms", decodeParms);
setBitsPerComponent( 1 );
setColorSpace( new PDDeviceGray() );
setWidth( decodeParms.getInt("Columns") );
setHeight( decodeParms.getInt("Rows") );
}
Construct from a tiff file. Parameters:
doc - The document to create the image as part of.
raf - The random access TIFF file which contains a suitable CCITT compressed image
Throws:
IOException - If there is an error reading the tiff data.
|