I'm working on a pdf that is generated using migradoc. However the Header and main section are overlapping when a row in the header expands due to a larger address than 3 or 4 lines.
I have used the answer on MigraDoc table goes over header on page 2? but the top margins will not move at all.
Where am I going wrong?
Section section = doc.AddSection();
section.PageSetup.TopMargin = Unit.FromCentimeter(4);
MigraDoc.DocumentObjectModel.Tables.Table quoteTable = section.Headers.Primary.AddTable();
quoteTable.Style = "Table";
quoteTable.Borders.Color = Colors.Black;
quoteTable.Borders.Width = 0.25;
quoteTable.Borders.Left.Width = 0.5;
quoteTable.Borders.Right.Width = 0.5;
quoteTable.Rows.LeftIndent = 0;
quoteTable.TopPadding = 3;
quoteTable.BottomPadding = 3;
quoteRow = quoteTable.AddRow();
quoteRow.HeadingFormat = true;
quoteRow.Format.Alignment = ParagraphAlignment.Center;
quoteRow.Format.Font.Bold = true;
quoteRow.Shading.Color = Colors.White;
quoteRow.Cells[0].AddParagraph("Customer Name");
quoteRow.Cells[0].MergeDown = 2;
quoteRow.Cells[0].Format.Alignment = ParagraphAlignment.Left;
quoteRow.Cells[0].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Top;
quoteRow.Cells[0].Format.Font.Bold = true;
quoteRow.Cells[0].Shading.Color = headingColour;
quoteRow.Cells[1].AddParagraph(contactName + Environment.NewLine + completeAddressDetails);
quoteRow.Cells[1].MergeDown = 2;
quoteRow.Cells[1].Format.Alignment = ParagraphAlignment.Left;
quoteRow.Cells[1].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Top;
MigraDoc.DocumentObjectModel.Tables.Table prodTable = section.AddTable();
prodTable.Style = "Table";
prodTable.Borders.Color = Colors.Black;
prodTable.Borders.Width = 0.25;
prodTable.Borders.Left.Width = 0.5;
prodTable.Borders.Right.Width = 0.5;
MigraDoc.DocumentObjectModel.Tables.Row row = prodTable.AddRow();
row.Format.Alignment = ParagraphAlignment.Center;
row.Format.Font.Bold = true;
row.Shading.Color = Colors.LightGray;
row.BottomPadding = 3;
row.TopPadding = 3;
row.Cells[0].AddParagraph("Manufacturer Product Code");
row.Cells[0].Format.Alignment = ParagraphAlignment.Left;
row.Cells[0].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Bottom;
row.Cells[1].AddParagraph("Product Description");
row.Cells[1].Format.Alignment = ParagraphAlignment.Left;
row.Cells[1].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Bottom;
row.Cells[2].AddParagraph("Qty" + Environment.NewLine + " Required");
row.Cells[2].Format.Alignment = ParagraphAlignment.Right;
row.Cells[2].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Bottom;