Can the skipped pages have headers/backgrounds from either section?
No, AFAIK you cannot have this automatically.
In our application, we use a different way of adding backgrounds: every section gets a tag that indicates which background has to be used. We render the pages in a loop of our own, adding the backgrounds before the page is rendered.
See the Mix MigraDoc and PDFsharp sample on using RenderPage:
http://www.pdfsharp.net/wiki/MixMigraDocAndPdfSharp-sample.ashx
Here's a code snippet:
// Check tags of all pages
for (int idx = 0; idx < pageCount; idx++)
{
DocumentObject[] docObjects = docRenderer.GetDocumentObjectsFromPage(idx + 1);
if (docObjects != null && docObjects.Length > 0)
{
Section section = docObjects[0].Section;
DocumentSectionTag sectionTag = null;
if (section != null)
sectionTag = section.Tag as DocumentSectionTag;
if (sectionTag != null && sectionTag.Name != sectionName)
{
// Your code to handle the background information goes here
DocumentSectionTag is a class we defined to transport the information we need. Our page backgrounds are pages from a PDF file, so we only need the page number.