Hi 

im trying to set an alpha for the transparency of a color (background color
of a table cell). Using Color java.awt with alpha value is not working, so i
tried it witih a cell event like this: 

public class TransparentCollorEvent implements PdfPCellEvent {

                private Color color;
                
                public TransparentCollorEvent(Color color) {
                        this.color = color;
                }
                
                @Override
                public void cellLayout(PdfPCell cell, Rectangle rect, 
PdfContentByte[]
canvases) {
                        PdfContentByte cb = 
canvases[PdfPTable.BACKGROUNDCANVAS];
            cb.saveState();
            PdfGState pdfGState = new PdfGState();
            pdfGState.setFillOpacity(color.getAlpha());
            cb.setColorFill(color);
            cb.fill();
            cb.restoreState();
                }
                
        }

Still i dont get the result i want. What am i doing wrong?

greetings and thx



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Make-Cell-Background-color-transparent-tp4659332.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to