Are custom PDF page headers supported?

Hello

Is it possible to have one header for first page of PDF and another one header for other pages with your library?

Our PDF have first page header with logo and rest of pages without logo

I’ve attached example of PDF we need to generate for reference

We generate PDF from HTML

1 Like

If the first page is its own HTML, then yes, you would just call something like the following.

PDFDoc doc = new PDFDoc();
HTML2PDF converter = new HTML2PDF();
converter.InsertFromURL(url_00);
converter.Convert(doc); // puts one page into the PDF
converter = new HTML2PDF();
converter.SetHeader(header);
converter.SetFooter(footer);
converter.InsertFromURL(url_01);
converter.Convert(doc); // adds remaining pages with header and footer.

If the page number is not how you expect/want, you could pre or post process the PDF. For example add dummy blank pages to the HTML or PDF.

1 Like

I get an error when trying to use the setFooter or setHeader method.
I’m running the “@pdftron/pdfnet-node”: “^11.0.0”,

1 Like