Community

Create table block wih Java Answered

Hello,

How can I create table with Java (table with much cells). I use FRE12 for Linux.

I need to set manually where the specific column is.

Thank you.

Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Nadezhda A. Solovyeva

    Hello

    Here is how to create a table. Please use the code below instead of Document.Process()

    ILayout layout = document.getPages().getElement(0).getLayout();
    IRegion tableRegion = engine.CreateRegion();
    tableRegion.AddRect(0, 0, 500, 500);
    IIntsCollection horzSeparators = engine.CreateIntsCollection();
    horzSeparators.Add(100);
    horzSeparators.Add(200);
    horzSeparators.Add(300);
    horzSeparators.Add(400);
    IIntsCollection vertSeparators = engine.CreateIntsCollection();
    vertSeparators.Add(250);
    ITableBlock tableBlock = layout.getBlocks().AddNew(BlockTypeEnum.BT_Table, tableRegion, -1).GetAsTableBlock();
    tableBlock.InitializeGrid(horzSeparators, vertSeparators); // create table with 2 columns: at 0px and at 250px
    // and 5 rows, each of 100 px height
    document.Recognize(null, null);
    document.Synthesize(null);

     

    0
  • Avatar
    FaL keN

    Hello Nadezhda,

    Thank you for answer.

    0

Please sign in to leave a comment.