oh. i see. totally didn't get what you are looking at.
This would be a bit of a problem.
in short - you can determine at times to provide your own stream implementation to replace the default flate compression.
Now any stream that requires compression will consult the extender whether to use the default flate compression or a custom one that you will provide.
At least, when compression is requried. you can set a flag on the pdfwriter to avoid compression completly.
However, the TiffImageHanlder as is determines its own compression, and so specfically asks the object context to provide unfiletered streams. you can see the relevant lines
here and
here. it then writes the output in whatever compression that's best fitting to the tiff data. in our case - ccit. unfortunately, unfiltered steram writing completly ignore the extension mechanism, and so you can't override it providing the extra flate encoding that you want (b.t.w, flate encoding, is simple, just use OutputFlateEncodeStream as a returned instance when asked to provide a stream).
There's couple of ways around it, to implement what you want, and they require a change in the library code.
1. You can change the implementation of the pdfstream to also consult the compression query in case of unfiltered stream requests. Then implement your extender, and when writing a tiff image, add your compression.
2. You can change teh implementation of tiffimagehandler to optionally take the default streams in case of unfiltered streams. this would return the default flate stream, and so you'll get what you want (or ask and external party to provide a stream and send the flate stream). you will want to implement something that asks you every time which option to take - as you said, you want it only on some pages, not all. best route here is to add elements to IObjectContextExtender particular for tiff writing, and consult them from the TiffImageHandler.
3. you could write your own tiff image handler.
i think the best options is (2). extend IObjectContextExtender to have a particular tiff stream request. if return null - use the default stream, if return something, use it instead. then call this method from the tiffimagehandler (the two lines i referred to). implement your own extender, with only this method (use the ObjectsContextExtenderAdapter to provide default implementations for the rest - and be nice and add your own default for your new method). in your method determine when to return null or an OutputFlateEncodeStream and done.
hope this works.
If you need more help with this, let me know.
Gal.