Quick question: I noticed for the header and foote...
# advancedpdf
j
Quick question: I noticed for the header and footer in the standard advanced PDF transaction templates, such as sales order, the header and footer macro tags differ from the FreeMarker documentation. NetSuite uses <macrolist><macro> while FreeMarker uses #maco with no mention of a macro list. I couldn't find any documentation specifically on NS use of macro. Also, the NS macro for header/footer is invoked as attributes to the <body> tag. Is this just a NS custom coding? If anyone know of documentation on it, that would be nice to know. But secondly, inside the NS <macro>, I can't get a FreeMarker #assign variable to evalutate. It gives an "undefined" error. Are these NS <macro> blocks evaluated before the FreeMarker-defined local variables?
c
NetSuite has their own flavor of the Freemarker version it seems. You can display the version with the freemarker tags but even some of the things don't work in NS that work for that version in Freemarker. #assign does work though I've used it thousands of times. <#assign xyz = abc>. It most likely is your actual code that is causing that issue. If you are allowed/can paste some of it, we may be able to better help you out. I also check suiteanswers sometimes if I am super stumped as that is where you'll find 99% of the helpful "documentation" within the answers. I used macros and functions quite a bit in my PDFs. You add a macro the the macro list and you should be ok. Just follow the same structure. Functions are just like they are in freemarker and I haven't fun across anything weird with them yet. Just remember macros only DISPLAY info and functions can't display and return data. That's about the hardest part.
j
Thank you. It's not the #assign coding; that variable is available and works fine outside the <macro> block. But okay, I can use the NS syntax macrolist/macro, but still do not understand or can find any documentation of the "header/footer" attribute invocation in the body tag. How do you invoke your own macro?
c
I believe in the body tag there's an option for header and footer you can specify
Copy code
<macrolist>
        <macro id="nlheader">
You'll see something like this at the top usually. Then the body tag says what it uses:
Copy code
<body header="nlheader" header-height="10%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
so just replace the id with your custom one and it should * work
j
Okay, that makes sense, but then you're limited to macros for the header and footer only. Have you tried the FreeMarker #macaro syntax?
c
I've only use macro
r
The <macro> tags in the template are not from Freemarker but from the BFO Engine which generates the actual PDF. That might be where the confusion came from.
👍 1