View previous topic :: View next topic |
Author |
Message |
Chezhian
Joined: 21 Apr 2009 Posts: 3
|
Posted: Tue Apr 21, 2009 2:42 pm Post subject: Header and Footer |
|
|
I am using the migradoc and would like to set the footer with page numbers like Page 1 of 10 and so on..
Appreciate your help on how to do this.
Thanks |
|
Back to top |
|
 |
Leo
Joined: 17 Apr 2009 Posts: 4
|
Posted: Fri Apr 24, 2009 9:46 am Post subject: |
|
|
Hello Chezhian, this is what I do ta add on footer the page number:
Code: | p = New Paragraph()
p.AddText("Pag.")
p.AddPageField()
p.AddText(" di ")
p.AddNumPagesField()
p.Format.Alignment = ParagraphAlignment.Right
section.Footers.Primary.Add(p) |
I hope could be usefull for you. |
|
Back to top |
|
 |
Chezhian
Joined: 21 Apr 2009 Posts: 3
|
Posted: Fri Apr 24, 2009 7:01 pm Post subject: |
|
|
Thanks Leo for answering my question.
Sorry it did not help me I have mulitple pages for example (10 pages) then on each page I need to have the footer like Page 1 of 10.. Page 2 of 10 etc., |
|
Back to top |
|
 |
Leo
Joined: 17 Apr 2009 Posts: 4
|
Posted: Sun Apr 26, 2009 11:45 am Post subject: |
|
|
I paste my entire code to generate my pdf document. The footer with page number indication works in each page for me:
Code: |
Dim style As Style
pdfDocument = New Document()
[.......]
Dim section As Section
Dim r As Row
Dim c As Column
section = pdfDocument.AddSection()
[...........]
'Aggiungo il numero di pagina in basso a destra
p = New Paragraph()
p.AddText("Pag. ")
p.AddPageField()
p.AddText(" di ")
p.AddNumPagesField()
p.Format.Alignment = ParagraphAlignment.Right
section.Footers.Primary.Add(p) |
I removed the code I think aren't usefull for your needs... |
|
Back to top |
|
 |
Chezhian
Joined: 21 Apr 2009 Posts: 3
|
Posted: Mon Apr 27, 2009 3:22 pm Post subject: |
|
|
Thank you very much Leo for your time.
It worked for me now  |
|
Back to top |
|
 |
|