Minimum row height that can be set for a row in a table

Hi,

Can you please let us know what is the minimum row height that can be set for a row in a table ?

What does this minimum value depend on ?

When I created a new pdf with a table and when I set a row height below 20 ,there is no change when the table is rendered on the pdf document. (This was done with Aspose.pdf 4.2). Is there any restriction on the minimum row height ?

Praveen


Hi Praveen,

Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for Java 4.5.0 where I have used the following code snippet and I am able to set the minimum row height for the table row.

[Java]

// create Document instance
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();

// add page to PDF document
doc.getPages().add();

//Instantiate a table object
com.aspose.pdf.Table table = new com.aspose.pdf.Table();

//Add the table in paragraphs collection of the desired section
doc.getPages().get_Item(1).getParagraphs().add(table);

//Set with column widths of the table
table.setColumnWidths("50 50 50");

//Set default cell border using BorderInfo object
table.setDefaultCellBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, 0.1F));

//Set table border using another customized BorderInfo object
table.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, 1F));

//Create MarginInfo object and set its left, bottom, right and top margins
com.aspose.pdf.MarginInfo margin = new com.aspose.pdf.MarginInfo();
margin.setLeft(5f);
margin.setRight(5f);
margin.setTop(5f);
margin.setBottom(5f);

//Set the default cell padding to the MarginInfo object
table.setDefaultCellPadding(margin);

//Create rows in the table and then cells in the rows
com.aspose.pdf.Row row1 = table.getRows().add();
row1.setFixedRowHeight(15);
row1.getCells().add("col1");
row1.getCells().add("col2");
row1.getCells().add("col3");
row1.getCells().get_Item(1).setDefaultCellTextState(new com.aspose.pdf.TextState(20));

com.aspose.pdf.Row row2 = table.getRows().add();
row2.getCells().add("item1");
row2.getCells().add("item2");
row2.getCells().add("item3");

// save the PDF document
doc.save("c:/pdftest/TableDOM_new.pdf");

Hi,

Sorry ,I did not mention …it was done with aspose.pdf packages of 4.2 version and not com.aspose.pdf …

Regards
Praveen

Hi,

Sorry ,table is not there in com.aspose.pdf package in 4.2.

Can you check this with aspose.pdf 4.2 ?

Regards
Praveen


Hi Praveen,


The Table/Cell/Row classes were added in recent release versions of Aspose.Pdf for Java so we recommend you to please try upgrading to latest release versions. Furthermore, the latest release contains many new features and fixes for issues reported in earlier versions.

Please note that you are using legacy approach of aspose.pdf package and I am afraid we are not fixing issues in legacy approach. So it’s highly recommended to migrate your code to latest DOM approach of com.aspose.pdf package.