Hi,

I've updated to setBorder method of rectangle to enable or disable borders.
Below is the code snippet used to disable top border:-

style.getRectangle().setBorder(Rectangle.NO_BORDER);
style.getRectangle().enableBorderSide(Rectangle.LEFT);
style.getRectangle().enableBorderSide(Rectangle.RIGHT);
style.getRectangle().enableBorderSide(Rectangle.BOTTOM);

For without top and bottom border as :-
style.getRectangle().setBorder(Rectangle.NO_BORDER);
style.getRectangle().enableBorderSide(Rectangle.LEFT);
style.getRectangle().enableBorderSide(Rectangle.RIGHT);

If Row span is 4 ,
Style for my first cell will be without bottom border..
For cell 2 will be without top and bottom border.. Similiar for cell 3..
For cell 4 , style with be without top border..

Visually on PDF, Border width for left and right border Cell 1 and cell 4
looks thinner than cell 2 and cell4.
Difference in border width is prominent but in print , width is same for
all.

In cell creation, below is the code snippet used..

String text = "Data"
Chunk chunk = new Chunk(text, font);
Paragraph para = new Paragraph(chunk);
PdfPCell cell = new PdfPCell(para);
cell.cloneNonPositionParameters(cellStyle.getRectangle());
cell.setColspan(colSpan);
cell.setHorizontalAlignment(cellStyle.getHorizontalAlignment());
cell.setVerticalAlignment(cellStyle.getVerticalAlignment());
cell.setUseBorderPadding(true);
cell.setUseDescender(true);
cell.setUseAscender(true);
cell.setFixedHeight(rowSpan * tableRowHeight);

cellStyle is the style provided to the cell. It contains border width ,
border colors , horizontal and vertical alignment etc.

Please suggest what can be done to correct this..


1T3XT info wrote:
> 
> iText_forum wrote:
>> Hi,
>> 
>> I've applied style on cell by setting border top and border width aer
>> width
>> as s 0 as
>> 
>> style.getRectangle().setColumnWidthTop(0).
> 
> It's better to remove the border with setBorder() then to set the width 
> to 0. Different devices will show a border anyway.
> 
>> It sets top border width as 0.
>> 
>> In PDF view , width of left and right border seems to be double of
>>  specified width but in print it is correct. 
>> Please suggest what can be wrong.
> 
> Nothing is wrong. The rendering of line thickness depends on the 
> resolution used by your device.
> -- 
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
> 
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge  
> This is your chance to win up to $100,000 in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full
> prize  
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> 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
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/No-top-and-bottom-border-of-Cell-tp24463993p24475822.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
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
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to