andre72
asked on
Add footer do migradoc document
Hi,
I need to create a document with simple table.
That works fine at all but I like to have a footer there counting the pages, eg.
Page X of Y ...
For the samples I found it looks very simple:
Add a footer and the content for to a section - but my footer will never been shown ...
Any idea what's wrong here?
Thanks
Andre
I need to create a document with simple table.
That works fine at all but I like to have a footer there counting the pages, eg.
Page X of Y ...
For the samples I found it looks very simple:
Add a footer and the content for to a section - but my footer will never been shown ...
Any idea what's wrong here?
Thanks
Andre
public class Invoice
{
Document document;
Table table;
Section section;
TextMeasurement tm;
public Invoice()
{
}
public Document CreateDocument(DataTable dt)
{
this.document = new Document();
this.document.Info.Title = "Rechnung";
this.document.Info.Subject = "";
this.document.Info.Author = "";
DefineStyles();
CreatePage();
FillData(dt);
return this.document;
}
void DefineStyles()
{
Style style;
style = this.document.Styles["Normal"];
style.Font.Name = "Arial";
style.Font.Size = 7;
style = this.document.Styles[StyleNames.Footer];
style.ParagraphFormat.AddTabStop("8cm", TabAlignment.Center);
style = this.document.Styles.AddStyle("Table", "Normal");
style.Font.Name = "Arial";
style.Font.Size = 7;
}
void CreatePage()
{
section = this.document.AddSection();
// Create footer
Paragraph paragraph = section.Footers.Primary.AddParagraph();
paragraph.AddText("PowerBooks Inc · Sample Street 42 · 56789 Cologne · Germany");
paragraph.Format.Font.Size = 9;
paragraph.Format.Alignment = ParagraphAlignment.Center;
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Seems that not so much EE use MigraDoc ...
ASKER