Question

I would like to know how set DOMPDF library (https://github.com/dompdf/dompdf) to start paging from given value?

Default behavior: starts at 1

Wanted behavior: start at let's say 3

Was it helpful?

Solution

Use CSS and increment the page counter. So long as your increment element appears before you insert the page number this will work:

<html>
<head>
  <style>
  .move-ahead { counter-increment: page 2; position: absolute; visibility: hidden; }
  .pagenum:after { content:' ' counter(page); }
  </style>
</head>
<body>
  <div class="move-ahead"></div>
  <p class="pagenum">Page</p>
</body>
</html>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top