You can add a TextFrame to the footer (AddTextFrame()
) and assign an absolute position to this textframe.
See also:
http://forum.pdfsharp.net/viewtopic.php?p=6928#p6928
Вопрос
I am trying to place an image as the footer of each page, I can move the footer closer to the bottom of the page using:
doc.DefaultPageSetup.FooterDistance = "0cm"
But I cannot seem to find a way to allow a shorter distance from the sides of the page. Is there a way to do this or some kind of "trick" to achieve this.
The only way I can find is by removing the page setup margins, but I need them to hold the page together.
Does anyone know a way around this or some setting I am missing?
Решение
You can add a TextFrame to the footer (AddTextFrame()
) and assign an absolute position to this textframe.
See also:
http://forum.pdfsharp.net/viewtopic.php?p=6928#p6928
Другие советы
Document document = new Document();
Section section = document.AddSection();
Section.PageSetup.BottomMargin = "1cm"; // according to data size
Paragraph paragraph = section.Footers.Primary.AddParagraph();
paragraph.AddText("XYZ ltd");
paragraph.Format.Alignment = ParagraphAlignment.Center;