Summary
I am using Aspose.PDF to generate a PDF-document using XSL-FO. I am currently struggeling with generating some content that should only appear on the bottom of the last page. As I have understood, the correct approach to do this is to use so called conditional page master references so that the footer on the last page also contains the content in addition to the normal footer content found on every other page.Test one:
I have a page-sequence-master as follows:
<fo:page-sequence-master master-name="A4-Conditional">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="A4"/>
<fo:conditional-page-master-reference page-position="last" master-reference="A4-last"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
"A4-last" has a footer that says "After last" and "A4" says "After all other" in the footer
This results in the following on a four page PDF:
- The first page displays nothing att the bottom of the page
- The second and third page displays "After all other"
- The last and fourth page displays both texts overlapping each other!
Test two:
I then tried to set page-position="rest" on the conditional-page-master-reference that uses "A4" and that resulted in both footers only displaying at the last page but not overlapping.
This really seems like a bug in Aspose.PDF since many sources says that this is the way of doing this in XSL-FO. Or is there another way to acomplish this?
This really seems like a bug in Aspose.PDF since many sources says that this is the way of doing this in XSL-FO. Or is there another way to acomplish this?
Both test cases are in the attached ZIP-file.