Hi all,
I’m trying to resolve a request about pdf printing: when I select and print multiple records in a custom module, the content of the “my_field” field only needs to be printed once.
Is there a way to get this?
I’m looking at formLetterPdf.php and the other files but I don’t know exactly where to intervene.
Unfortunately t’s pretty complicated. Now I’m using the slightly customized formLetterPdf.php on listview because I need a header and a footer. In this case, the “$pdf-> AddPage ();” row doesn’t run and I have the records printed one after the other.
What I just don’t know is how to intercept a specific field and print it only once.
I already have a slightly changed “formLetterPdf.php” at this point:
if ($bean->module_dir != 'my_module') {
$pdf->AddPage();
}
This allows me to print my_module records from listview in a table, row by row.
(it is perhaps an incorrect change but it does what I need.)
So, now I’m basically trying to add a page first of all. This page has different content, may have different header and footer, or may not have them at all (this is not critical but it cannot have template header and footer).
Well, I can add “Hello world” in front of everything from code (always just for my_module with an if):
But it happens that the generation of the pdf prepends the header before the creation of the new page, so my next page (the one generated inside the for each loop) loses the header (which starts from the second page instead.
So, is there a way to create some sort of break section between the first page and the next create with standard “for each” in order to take the header from the first page?
Thank you very much … I hope I have explained a little …
Great tip!
In fact, all you need is in their guide.
Just play with AddPage () where you can set many parameters (even different headers for odd and even pages). Thanks!