How can I align grid nested in a cell to the bottom?
I know
new PdfStringFormat(PdfTextAlignment.Left, PdfVerticalAlignment.Bottom) can be used for text, but how is it for non-text?
public void AlignNestedGrid()
{
using (PdfDocument pdfDocument = new PdfDocument())
{
//Create the page
var section = pdfDocument.Sections.Add();
var pdfPage = section.Pages.Add();
section.PageSettings.SetMargins(25);
pdfDocument.PageSettings.SetMargins(25);
//Create the parent grid
PdfGrid pGrid = new PdfGrid();
FillGrid(pGrid, "pGrid", 5, 4);
PdfGrid child1 = new PdfGrid();
FillGrid(child1, "child1", 2, 2);
pGrid.Rows[4].Height = 80;
pGrid.Columns[3].Width = 100;
pGrid.Rows[4].Cells[3].Value = child1;
// QUESTION: how to align child1 grid to the bottom?
pGrid.Rows[4].Cells[3].StringFormat = new PdfStringFormat(PdfTextAlignment.Left, PdfVerticalAlignment.Bottom);
//Draw the parent PdfGrid
pGrid.Draw(pdfPage, PointF.Empty, new PdfGridLayoutFormat { Break = PdfLayoutBreakType.FitPage, Layout = PdfLayoutType.Paginate });
//Save the document
pdfDocument.Save("NestedTable.pdf");
//Close the document
pdfDocument.Close(true);
//This will open the PDF file so, the result will be seen in default PDF viewer
System.Diagnostics.Process.Start("NestedTable.pdf");
}
}