Free Support Forum - aspose.com

Minimum Height for Row

I'm currently using Apose.Pdf v7.0.0.0 (Prod Ver. 2012.05.03) and am trying to set a "minimum" height for a Row. Basically, I want the Row to be set to a specific minimum height with the ability to grow vertically if stretched by content.

At the moment it seems I can either have a FixedRowHeight or nothing at all. If I set a FixedRowHeight, the Row obviously never grows any larger. If I don't, however, the row is not initially tall enough to display my content the way I want. I believe I've seen the property in other Aspose products like Aspose.Slides or Sliders or something. Does it not exist for Pdf generation?

Thanks.

Hi David,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am afraid, your requested feature in not available at the moment. I have created a new feature request in our issue tracking system with issue id: PDFNEWNET-34042. Our development team will further look into this feature and see if it can be supported in near future.

Sorry for the inconvenience,

Hi David,


Thanks for your patience.

In order to accomplish your requirement, please try using the following code snippet. For your reference, I have also attached the resultant PDF which is generated over my end.

[C#]

string outFile = “c:/pdftest/MinRow_34042.pdf”;<o:p></o:p>

Document doc = new Document();

Page page = doc.Pages.Add();

//Create a Table object

Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();

//Add the Table object in the paragraphs collection of the section

page.Paragraphs.Add(tab1);

//Set column widths of the table. We need to specify the ColumnCount manually.

// As the curent excel worksheet has three columsn, so we are specifying the same count

tab1.ColumnWidths = "40 100 100";

//Set default cell border of the table using BorderInfo object

tab1.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F);

//Create rows in the table and then cells in the rows

Aspose.Pdf.Row row1 = tab1.Rows.Add();

row1.Cells.Add("col1");

row1.Cells.Add("col2");

row1.Cells.Add("col3");

Aspose.Pdf.Row row2 = tab1.Rows.Add();

row2.MinRowHeight = 100;

row2.Cells.Add("item1");

row2.Cells.Add("item2");

row2.Cells.Add("item3");

doc.Save(Path.GetFullPath(outFile));