At first I assumed that the viewer environment was different than the extraction environment, because of either classpath, or some encryption callback, or other hook that the viewer does outside of the core, in the RI. I tracked down every possible JAR and callback, and tried either adding them to the extraction, or removing them from the viewer. Nothing made a difference.
Then, I tracked into the Stream and Shapes classes, to examine the resulting parsed image, thinking that this would show whether the problem was parsing the image or displaying it. Those classes showed that they had the signature image in a valid state, properly parsed.
So I then examined what could be causing the image to not be displayed properly. I thought that maybe the clipping was working for one and not the other, maybe due to some round-off error. When disabling the clipping and transforming, I saw that the black area then moved and grew, which indicated that the image was being drawn, just somehow as all black, even though it showed up as a signature when painted on the viewer frame and in my test JFrame. Commenting out the image drawing command made the black disappear. So the black rectangle was not the omission of the image, it was how the image was coming across. So, somehow it was being drawn differently in the two contexts.
This made me think that I should draw it into a regular RGB image, instead of right into the black and white image, since maybe something about the destination image made it lose information, leaving only black. But the source image was black and white too, so that didn't add up. Then I clued in to see if the source image had any alpha related attributes. It did, being an image mask. The destination image was opaque, and did not support alpha. So, I experimented making the destination image not be opaque, and instead either use a bit mask or translucence. Both worked, in Java 1.6 and Java 1.5. So I went with the bit mask.
Subversion 20098
icepdf\examples\captureMultiple\MultiPageCapture.java
This capture example opens a PDF whose path is given on the command line, goes through every page in it, draws the page onto a black and white image, and feeds that to ImageIO, which writes a multi-page CCITT fax group 4 compressed TIFF file. The zoom level used on each page is calculated to give 300 (print) or 200 (fax) DPI of resolution.
Subversion 20023
icepdf\examples\captureMultiple\MultiPageCapture.java
Subversion 22150
icepdf-pro\resources\lib\jai_imageio.jar