문제

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

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top