I tried to add 3 footer contents to PDF using MigraDoc. Here the contents are not aligning in the same line.
MigraDoc.DocumentObjectModel.Paragraph paragraph = section.Footers.Primary.AddParagraph();
section.PageSetup.DifferentFirstPageHeaderFooter = true;
paragraph.AddText(Environment.NewLine + title);
paragraph.Format.Font.Size = 7;
paragraph.Format.Alignment = ParagraphAlignment.Left;
MigraDoc.DocumentObjectModel.Paragraph middle = section.Footers.Primary.AddParagraph();
middle.AddText(operatorName + " "+ methodToRun);
middle.Format.Font.Size = 7;
middle.Format.Alignment = ParagraphAlignment.Center;
MigraDoc.DocumentObjectModel.Paragraph created = section.Footers.Primary.AddParagraph();
created.AddText("Created: " + DateTime.Now.ToString("MMMM dd, yyyy HH:mm zzz"));
created.AddTab();
created.Format.Font.Size = 7;
created.AddText(" Page ");
created.AddPageField();
created.Format.Alignment = ParagraphAlignment.Right;
Using above code footer contents are not aligned in same line. Can anybody give a suggestion to align the footer contents in same line?
If you want to have three elements in a single-line footer, you can achieve this by using tap stops.
Just remove all default tap stops, add a centre-aligned tab stop in the middle, a right-aligned tab stop at the right edge. Then add the contents to a single paragraph, separated by tab stops.
Sample code, assuming A4 page with default margins: