Hi, I’m using Aspose.PDF to create a PDF using the XML binding approach, and I would like to ask if I can handle even and odd pages differently.
For example, I would like to have a different footer for even pages and a different one for odd pages.
Thanks for your time!
Hi there,
Thanks for your inquiry. You can easily handle header/footer against even and odd pages. Please check following documentation link for sample code snippet/XML.
Please feel free to contact us for any further assistance.
Best Regards,
Thanks for the reply.
I used the attributes and separate the footers to odd and even using the Type attribute. My problem now is that the even footer does not appear on even pages. The odd footer appears correctly.
Here is a fragment from the XML I have used:
Do you notice a mistake? Also can I have “$p/$P” instead of “$p / $P”?
<Table ID=“op-content1” ColumnWidths=“50% 50%” DefaultCellPaddingTop=“5” DefaultCellPaddingLeft=“5” DefaultCellPaddingRight=“10”
DefaultCellPaddingBottom=“5” MarginBottom=“0.5cm” MarginLeft=“2.7cm” MarginRight=“2.73cm” IsKeptTogether=“false”>
>
…
<Table…>
…
…
$p / $P
…
…
…
…
$p / $P
…
Hi Giorgos,
Thanks for sharing the details.
I have tested the scenario and I am able to notice the same problem that the footer is not appearing on even pages. For the sake of correction, I have logged this issue as PDFJAVA-33194 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us a little time. We are sorry for this inconvenience.
Now concerning your query “Also can I have “$p/$P” instead of “$p / $P”?”, as per my understanding, you do not want to have a space between $p and $P. If so is the case, then please note that if we do not add a space at the end of $p or $P, the symbol is not properly replaced. It’s a known issue. In case of any further query, please feel free to contact.