Forum Bugs

Extra blank page when first element is "position: running(named-element)"

quiredan
We recently upgraded to the latest version of Prince and wanted to start using position: running() instead of prince-flow: static() since the former is part of the official spec.

Everything seems to be working fine, but we're getting a blank page at the start of the document when using position: running() but NOT when using prince-flow: static() when it's used on the first element(s) in the document.

Our HTML looks roughly like this:

<html>
<body>
  <header class="header-box"></header>
  <footer class="footer-box"></footer>
  <div class="page"></div>
  <div class="page"></div>
  <div class="page"></div>
  <div class="report-body">
    <section class="section"></section>
    <section class="section"></section> 
    <section class="section"></section>
    <section class="section"></section>
    <section class="section"></section>
    <section class="section"></section>
    <section class="section"></section>
  </div>
</body>
</html>


When we use this CSS everything works as expected:

.header-box {
  flow: static(header-box);
}
.footer-box {
  flow: static(footer-box);
}

.report-body {
  page: report-body;
}

@page report-body {
  margin: 1in;
  @top-center {
    content: flow(header-box);
  }
  @bottom-center {
    content: flow(footer-box);
  }
}


But when we use this, there's a blank page:

.header-box {
  position: running(header-box);
}
.footer-box {
  position: running(footer-box);
}

.report-body {
  page: report-body;
}

@page report-body {
  margin: 1in;
  @top-center {
    content: element(header-box);
  }
  @bottom-center {
    content: element(footer-box);
  }
}


There are some other things going on but the trigger seems to be the running elements.

Is this a bug or does position: running() just work differently than prince-flow?
jamespaden
I run into this frequently as well. Stumbled across this post while looking for an answer. Any ideas on how to avoid this? I normally put my headers as the very first element in a doucment.

Try DocRaptor - PrinceXML web service and official PrinceXML partner