Can we assign pagenumber value to some some other ...
# advancedpdf
d
Can we assign pagenumber value to some some other variable in freemarker for validation?
question answered 1
d
No
<pagenumber>
is a BFO tag. BFO is the PDF generator that takes the completed template from Freemarker (template engine). The variables you set in your template are resolved by Freemarker, before BFO is involved with generating the PDF, so it has no idea where the pages start/end or how many pages there will be total
w
I've been messing around with this a bit myself and what I found odd is that this gives me the correct values but I cannot use Freemarker if statements with it.
<td align="right"><pagenumber/> of <totalpages/>
<#assign numberPage = "<pagenumber/>">
<#assign pageTotal = "<totalpages/>">
/ Freemarker ${pageTotal} , ${numberPage}
</td>
message has been deleted
d
I was not expecting that behaviour tbh, I wonder how that works...
w
@David B Based on everything I've read and like you mentioned it shouldn't happen.