Hi,
I'm trying to add a gradient background behind a column text object based on
user input.
My code is as follows
Rectangle rectangle = new
Rectangle(element.getPositionx(),PageSize.A4.getHeight()-element.getPosition
y(),element.getPositionx()+element.getWidth(),PageSize.A4.getHeight()-elemen
t.getPositiony()-element.getHeight() );
if (element.getBackgroundColourGradient()!=null &&
!"".equals(element.getBackgroundColourGradient())) {
PdfShading shading =
PdfShading.simpleAxial(_writer,element.getPositionx(),PageSize.A4.getHeight(
)-element.getPositiony(),element.getPositionx()+element.getWidth(),PageSize.
A4.getHeight()-element.getPositiony()-element.getHeight(),
Color.decode(element.getBackgroundColour()),Color.decode(element.getBackgrou
ndColourGradient()),false,false);
PdfShadingPattern pattern = new PdfShadingPattern(shading);
ShadingColor axialColor = new ShadingColor(pattern);
_cbr.setColorFill(axialColor);
_cbr.rectangle(rectangle);
_cbr.fillStroke();
}
else {
rectangle.setBackgroundColor(Color.decode(element.getBackgroundColour()));
_cbr.rectangle(rectangle);
}
Basically an element will have two colour fields .. if you provide 1 it
makes the background solid, which works perfectly, but if you provide both
it fills the text with the gradient colour, not the underlying background.
Any help would be appreciated
Regards
Damian
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php