We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set VerticalAlignmentType for a row

Hi,


How i can set VerticalAlignmentType in new DOM for Aspose.Pdf.Row.

Regards,
Sandeep

Hi Sandeep,


Thanks for contacting support.

I am afraid the requested feature is currently not supported in DOM approach of Aspose.Pdf namespace. For the sake of correction, I have logged this requirement as PDFNEWNET-38580 in our issue tracking system. We will further look into the details of this requirement and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

At least provide me some workaround for this.

Hi Sandeep,


I am afraid currently I cannot share any workaround as its a limitation in API and it does not offer the feature to set vertical alignment for elements inside Row instance.

Hi Sandeep,


Adding more to my previous comments, you can set the Vertical Alignment for individual Cell object inside Row instance. Please try using following code snippet.

[C#]

//
Load source PDF document
<o:p></o:p>

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

doc.Pages.Add();

// Initializes a new instance of the Table

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

// Set the table border color as LightGray

table.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));

// set the border for table cells

table.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));

// create a loop to add 10 rows

for (int row_count = 1; row_count < 10; row_count++)

{

// add row to table

Aspose.Pdf.Row row = table.Rows.Add();

row.FixedRowHeight = 20;

// add table cells

row.Cells.Add("Column 1 - vertical").VerticalAlignment = VerticalAlignment.Bottom;

row.Cells.Add("Column (" + row_count + ", 2)");

row.Cells.Add("Column (" + row_count + ", 3)");

}

// Add table object to first page of input document

doc.Pages[1].Paragraphs.Add(table);

// Save updated document containing table object

doc.Save(“c:/pdftest/document_with_table.pdf”);

@sgargsaba

Thanks for your patience.

We are pleased to inform you that an enhancement request logged as PDFNET-38580, has been fulfilled in latest version Aspose.Pdf for .NET 17.11 and now you can use row.VerticalAlgnment property to set vertical alignment of entire row in a table. Please try using the latest release version and in case you face any issue, please feel free to contact us.