On 10/12/2013 12:59 PM, Noisebreath wrote:
> 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

You were very close to the solution. There was only one line missing. 
I've added it to your snippet below:

>               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.setGState(pdfGState);
>              cb.setColorFill(color);
>              cb.fill();
>              cb.restoreState();
>               }
>               
>       }


------------------------------------------------------------------------------
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