Hmmm...  I didn't realize these rectangles overlap.  I assumed that they
would be flushed next to each other.  In any case, thanks for the
explanation.  Turns out subtracting .5 from the area painted is not a
fail-proof solution.  Depends on zoom level, you can have the dark overlaps
or white gaps.  Using table event is perfect however.


1T3XT info wrote:
> 
> tlc wrote:
>> I have a table where its cells background are partially transparent.  The
>> cells' background are set using a CellEvent (see
>> http://www.nabble.com/Different-transparency-for-cells-in-PdfPtable-td21511310.html).
>>  
>> However, there is a border drawn for the cells
> 
> No, there isn't!!!
> 
>> even when I set the
>> borderWidth and border to 0. 
> 
> There is no border.
> 
>> How do I get rid of this border? 
> 
> You are drawing transparent rectangles.
> These rectangles overlap.
> I don't know if you know the Quality Street candy from MacIntosh.
> These sweets are wrapped in transparent paper.
> Let's say you take the sweets with strawberry. They have a red wrapping.
> Now if you overlap two of those wrappings, you get a deeper red.
> 
> That's what you see in your table: NOT BORDERS, but a deeper blue,
> because two transparent blue rectangles overlap.
> 
> Need proof? Change:
>>         cb.rectangle(rect.getLeft(), rect.getBottom(), rect.getWidth(),
>> rect
>>             .getHeight());
> 
> to:
> cb.rectangle(
>       rect.getLeft(), rect.getBottom(),
>       rect.getWidth() - 0.5f, rect.getHeight() - 0.5f);
> 
> There are of course, more elegant solutions.
> I'd use a table event instead of a cell event to avoid having to draw
> different rectangles.
> -- 
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Table-cells-border-appear-evem-when-BorderWidth-is-set-to-0-when-background-is-transparent-tp21691359p21715970.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
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

Reply via email to