How can I refer to the page number within an `<...
# advancedpdf
r
How can I refer to the page number within an
<#if>
directive? It appears that
<pagenumber/>
and
<totalpages/>
will output the page number and total pages, respectively, from a non-escaped context, but when I do
<#if pagenumber == totalpages></#if>
I get "null or missing".
n
Here is something you should do <#assign a><pagenumber /></#assign> <#assign b><totalpages /></#assign> <#if a==b> Your Code </#if> I am not sure if the comparison will be correct but you can't access pagenumber without '<>' so your if condition won't work the way you wrote it.
I am working on something similar but for me the problem is when I write <#if a== "1"> When I print ${a} it does print 1 on the PDF but when I compare, the condition fails and goes to else part. I am thinking this is a datatype issue. Will be trying a few things of my own. I'll let you in if I find out anything, Hope you would do the same. Thanks!