Using CSS Paged media, I want to create one type of header for first page and a different type for the rest of the pages

199 Views Asked by At

I have an HTML which defines the textual content of a letter. I need to use CSS Paged Media and PagedJS Polyfill to define one type of header for the first page and another for the rest of the pages.

I got the desired output. When I open the HTML and print it as PDF, I get the PDF with the desired formatting and headers.

However, we need to do the same programmatically by converting this HTML to PDF using Adobe's PDF services API which generates a truncated PDF.

Commenting the script reference to the PagedJS in HTML gets all pages converted, but the formatting goes off.

Is there any way to achieve the following without using PagedJS?

  • The first page should have one type of header (a logo will be shown)
  • The first page should have one type of footer (address logo will be shown)
  • The 2nd page onwards, till the end should have another type of header (only page number and date should be shown with a simplified logo)
  • The 2nd page onwards, no footer is to be shown.

The approach of using table with header and footer will not work as it only brings same header and footer through out all the pages.

0

There are 0 best solutions below