PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 11:12 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Header and Footer
PostPosted: Tue Apr 21, 2009 2:42 pm 
Offline

Joined: Tue Apr 21, 2009 2:39 pm
Posts: 3
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 24, 2009 9:46 am 
Offline

Joined: Fri Apr 17, 2009 3:59 pm
Posts: 4
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 24, 2009 7:01 pm 
Offline

Joined: Tue Apr 21, 2009 2:39 pm
Posts: 3
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.,


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 26, 2009 11:45 am 
Offline

Joined: Fri Apr 17, 2009 3:59 pm
Posts: 4
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...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Apr 27, 2009 3:22 pm 
Offline

Joined: Tue Apr 21, 2009 2:39 pm
Posts: 3
Thank you very much Leo for your time.
It worked for me now :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 414 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group