How can we set different header or footer content based on page.For example we need to display Image 1 as header for first page, and need to display Image 2 as header for second and next page
Hi Nadzir, AJ.
If your use case is similar to a cover page, this is now possible with version 5.0.
You should use two PrintLayout blocks on the same screen, and they will both be rendered with their own header/footer. So you can use a PrintLayout for page 1, and another PrintLayout for pages 2 onwards.
If your use case is not covered by this solution, please let me know.
Thanks.
Hi Leonardo,I'm having trouble with using this logic while having a dynamic page. This is, the number of pages my pdf has vary based on fields previously stored through application, e.g., a list of topics. With this being said, the solution I'm looking for is having the first page with one header and the rest with a different one. Can this be done through any kind of specific js or any other workaround?Thanks :)
Hi Rúben. Yes, you can do that.
The key is hiding the header on first page, a placing the first header at the top of the main content.
The Résumé PDF template exemplifies that. The first page has a special header including a larger candidate name and contact info, but the other pages will have a simpler header with just name and job title.
Hi again Leonardo,Thanks for the input, although I could find the resume PDF template that contains that logic to hide the first page header. Could you please share more info on where could I find it?Thanks
If you have a recent enough version of Ultimate PDF, you should see the template available when you create a new screen.
Hello @Nadzir Yahaya
As a user of this component, I believe this is not possible using Ultimate PDF alone. The component creator confirmed it in this Apr 2020 post.
As a work around, I recently suggested an alternative option in this post using the PDF Sharp component in addition to the Ultimate PDF. That post was about having different footers on different pages, but you can apply the solution to headers as well.
Though not a perfect one, it may still be a viable alternative especially if most of your pages have the same header/footer and you only need to append a few pages with different headers/footers for e.g. in the beginning and/or the end of the document.
Regards,
AJ
Hi AJ Thanks for your suggestion it's work on different header requirements. But do you have a solution if we need to print the page number for this append page?
Hello Nadzir,
Yeah that's quite a challenge and unfortunately I could not work out a solution/ work around for the page number continuity across appended pdf documents.