That's a viewer feature: the moment you have transparency the on-screen rendering mode changes. It will still print the same.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of jimmy Liu > Sent: Wednesday, February 15, 2006 5:27 AM > To: [email protected] > Subject: [iText-questions] Add a transparent PNG image to a > page, color of text or background will be changed > > hi, > I find Add a transparent PNG image to a page, color of text > or background will > be changed in this page. The test code as follows: > > import java.awt.Color; > import java.io.FileOutputStream; > import java.io.IOException; > > import com.lowagie.text.Chunk; > import com.lowagie.text.Document; > import com.lowagie.text.DocumentException; > import com.lowagie.text.Font; > import com.lowagie.text.FontFactory; > import com.lowagie.text.Image; > import com.lowagie.text.PageSize; > import com.lowagie.text.pdf.PdfContentByte; > import com.lowagie.text.pdf.PdfWriter; > > /** > * Add an image > */ > public class TestPngImage { > > /** > * Add an image using different transformation matrices. > * @param args no arguments needed > */ > public static void main(String[] args) { > // step 1: creation of a document-object > Document document = new Document(PageSize.A4); > > try { > // step 2: creation of the writer > PdfWriter writer = PdfWriter.getInstance(document, new > FileOutputStream("pngImage.pdf")); > document.open(); > > document.newPage( ); > Font font = FontFactory.getFont("Arial", 36, 0, > Color.magenta); > Chunk chunk = new Chunk("test", font); > document.add( chunk ); > document.newPage( ); > chunk = new Chunk("test", font); > document.add( chunk ); > PdfContentByte cb = writer.getDirectContent(); > Image img = Image.getInstance("test.png"); > img.setAbsolutePosition( 20, 20 ); > cb.addImage(img); > > } > catch(DocumentException de) { > System.err.println(de.getMessage()); > } > catch(IOException ioe) { > System.err.println(ioe.getMessage()); > } > document.close(); > } > } > > "test.png" is a transparent 24bit PNG image > > I find color of text in first page is different with the > second page. Is this > a bug of iText or something missing in code? > > Thanks > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. > DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486& > dat=121642 > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
