PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 7:01 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Apr 07, 2010 2:27 pm 
Offline

Joined: Wed Apr 07, 2010 1:05 pm
Posts: 3
I have a 3 pages document.

On page 1, the table continue on page 2, the footer is Ok
*** On page 2, the next table continue on page 3, but the footer is semi-masked but this table
on page 3, the footer is Ok

My footer is 2 lines and contains an image on 1st line then a text on 2nd line.

i add the footer then i add the tables
Code:
                [....]
                Dim section As MDO.Section = pdfDoc.AddSection()

                section.PageSetup.OddAndEvenPagesHeaderFooter = False

                Dim footer As New MDO.HeaderFooter()
                Dim para As New MDO.Paragraph()
                Dim font As New MDO.Font()
                Dim imageFooter As New MDO.Shapes.Image(FooterImage)
                para.Add(imageFooter)
                para.AddLineBreak()
                font.Color = MDO.Colors.SteelBlue
                para.AddFormattedText("Footer text goes here", font)
                para.Format.Alignment = MDO.ParagraphAlignment.Center
                footer.Add(para)

                section.Footers.Primary = footer
               
                CreateReportTable()
                [...]


see screenshot


Attachments:
File comment: footer on 1st page = OK
footer on 2nd page not OK

Footers.JPG
Footers.JPG [ 11.65 KiB | Viewed 9853 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 07, 2010 3:28 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
benb wrote:
On page 2, the next table continue on page 3, but the footer is semi-masked but this table
on page 3, the footer is Ok

It's a feature, not a bug.

Change the PageSetup to reserve enough space for the footers.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 07, 2010 4:14 pm 
Offline

Joined: Wed Apr 07, 2010 1:05 pm
Posts: 3
Could you please tell me which property i have to set?
Thank you very much


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 07, 2010 7:53 pm 
Offline

Joined: Wed Apr 07, 2010 1:05 pm
Posts: 3
I found my answer.

[Section].PageSetup.BottomMargin = Unit.FromCentimeter(x)

The bottom margin must be larger than the items added to the footer in my case image + text

example if my footer (image+text) is approx. 2cm i had to set [Section].PageSetup.BottomMargin = Unit.FromCentimeter(2.5)


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2023 9:55 pm 
Offline

Joined: Fri Mar 31, 2023 9:45 pm
Posts: 1
actually the answer is:

[Section].PageSetup.TopMargin = Unit.FromCentimeter(2.5);

(distance from the top of the margin to the beginning of the text)

but your comment was very helpful!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2023 3:53 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
LF99 wrote:
actually the answer is:

[Section].PageSetup.TopMargin = Unit.FromCentimeter(2.5);
This topic is about a table overlapping with the footer, so increasing BottomMargin is the solution for this topic.
If the header overlaps with other contents, then increasing TopMargin could be the solution.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 150 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