Hi there!

I was trying to create a table cell with a quite thick bottom border with the 
code at the end of the mail but to me it seemed every border-width value 
greater than 2 was reset to 2. So I took a look into the itext source where I 
found this snippet in RtfBorder.java:413

        if(borderWidth > 2) {
            borderWidth = 2;
        }

Is there a sound reason for this being here? If I edit the resulting file 
manually I can achieve thicker borders at will. I am using Windows 2003 for 
displaying rtf.

Best Regards,
Georg Nebehay


import java.awt.Color;
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.Rectangle;
import com.lowagie.text.Table;
import com.lowagie.text.rtf.RtfWriter2;
import com.lowagie.text.rtf.table.RtfBorder;
import com.lowagie.text.rtf.table.RtfBorderGroup;
import com.lowagie.text.rtf.table.RtfCell;



public class RtfTest {
        public static void main(String[] args) {
                try {
            Document document = new Document(PageSize.A4.rotate());
            
            RtfWriter2 w = RtfWriter2.getInstance(document, new 
FileOutputStream("testDocument.rtf"));
            document.open();
            
            Table t = new Table(2,1);
            
            RtfCell cell1 = new RtfCell();
            RtfCell cell2 = new RtfCell();

            cell1.setBorders(new RtfBorderGroup(Rectangle.BOTTOM,
          RtfBorder.BORDER_SINGLE, 10, new Color(255, 0, 0)));

            t.addCell(cell1);
            
            t.addCell(cell2);
            
            document.add(t);
            
            document.close();
            
    } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
    }
  }
}



-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to