7

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?

Ruddy
  • 9,795
  • 5
  • 45
  • 66

2 Answers2

2

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

0
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;
Shwabster
  • 479
  • 1
  • 10
  • 27
John Wick
  • 41
  • 2
  • This does not answer the question which is about adding images and reducing the left margin. This code-only answer shows how to draw text with default left and right margins and is not useful in the context of this question. – I liked the old Stack Overflow Jun 25 '19 at 05:41