PDFsharp & MigraDoc Foundation https://forum.pdfsharp.net/ |
|
Different pages, different headers/footers https://forum.pdfsharp.net/viewtopic.php?f=2&t=3858 |
Page 1 of 1 |
Author: | Anandir [ Thu Oct 11, 2018 8:48 am ] |
Post subject: | Different pages, different headers/footers |
Hi everyone, I'm lurking here around for the last few days, and thank you for the huge amount of really useful clarifications I've found so far! But I have a problem I can't solve. I need to make a PDF, with MigraDoc, with a quite "particular" format. I've several sections (Cover, TOC, Chapter 1, Chapter 2, and so on) and I need to have the first page of the section without any header/footer, but from page 2 until the end of the section, the header/footer should be present. I've tried several combination of Section.PageSetup.DifferentFirstPageHeaderFooter / Section.Headers.FirstPage / Section.Headers.Primary with no luck . Do you have any ideas on how can I have this behavior ? Thanks a lot in advance! Best regards |
Author: | Thomas Hoevel [ Thu Oct 11, 2018 9:22 am ] |
Post subject: | Re: Different pages, different headers/footers |
Hi! Anandir wrote: I've tried several combination of Section.PageSetup.DifferentFirstPageHeaderFooter / Section.Headers.FirstPage / Section.Headers.Primary with no luck This approach works when used properly.We use it in our applications. |
Author: | Anandir [ Thu Oct 11, 2018 9:30 am ] |
Post subject: | Re: Different pages, different headers/footers |
Thomas Hoevel wrote: Hi! This approach works when used properly. We use it in our applications. First of all, thanks for your reply! There are some example, that I didn't found, that I can use as "source of ideas"? What I'm doing at the moment is something like that (only for the footer at the moment): Code: actualSection.PageSetup.DifferentFirstPageHeaderFooter = true; BuildFirstFooter(actualSection.Footers.FirstPage); BuildFooter(actualSection.Footers.Primary); BuildFirstFooter, just an "empty footer": Code: private void BuildFirstFooter(HeaderFooter hr) { Paragraph paragraph = hr.AddParagraph(); paragraph.Format = new ParagraphFormat(); } In the BuildFooter function, a build the "real" footer. A table with some elements and a top border. I don't understand what I'm doing wrong here ! |
Author: | Anandir [ Thu Oct 11, 2018 1:20 pm ] |
Post subject: | Re: Different pages, different headers/footers |
After a partial rewrite the problem "is gone". Now is working properly. Probably something wrong happened in the code... Thanks a lot for the help! |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |