proof of concept of workaround for BFO's well know...
# advancedpdf
d
proof of concept of workaround for BFO's well known inability to specify a header/footer to print on the last page:
m
Can you elaborate on what's happening? How is this getting replaced?
d
doing it via script. It's not ideal, but the basic pattern is: print > count pages > alter template content > print again
have been thinking on it all day, the trick is that you print the footer on #page1 (or whatever page, it's configurable), and then change it to the last page. That way it takes up the same amount of space. The issue I have found is that it would potentially fail with particularly large containers, see diagram
c
so you're just making a template placeholder and replacing it with your code realtime? I do that sometimes myself.
a better PDF generator would be amazing. Real-time display of your changes and stuff. One can hope.
r
@creece Would that work, the real time replacement, if you use the native Print button?
m
@creece I haven't tried it but there is a Chrome extension that has a real-time preview in the editor
c
Yeah you can do it but the issue is netsuite has their own flavor of the BFO/Freemarker so its not gonna be 1:1.
thats what I'm aware of at least.. maybe its changed?
s
Nice. It's way easier to print a special footer/header only on the FIRST page, but the last has always been tough
@David B Hey did you get your script to handle this eventually? Trying to get it working with just freemarker.
d
spent many hours investigating. The only way to do it purely in Freemarker + BFO is the workaround of always adding a pagebreak at the end of the
body
and setting the footer attribute. haven't spent much more time on this project, will update here when I do
s
And an extra blank page isn't exactly 'fun'. Thanks and I'm always on the look out to see if this can be solved