Markus Meyer wrote: > I'm trying to apply smasks to an image like it is shown in the attached > example source code. This example is more or less taken from page 341 of > "iText in action" with the difference that the smask for the image is > not created from code but load from a file. > > The code runs through fine and the PDF is written, but when I open the > resulting PDF in Adobe Acrobat it says "Errors on this page" and the > transparent object is not displayed.
The SMask is the alpha channel of the image data, stored in a separate stream. The SMask needs to have the same size (height & width) as the Image, so that you can just start with an RGBA/ARGB canvas, copy the pixels from the image into the RGB part and then SMask data into the A's. In other words: an SMask image isn't really like a JPEG, GIF or PNG. I think it works in GS by accident. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
