Footers and Templates

323 views
Skip to first unread message

Tim

unread,
Apr 6, 2009, 4:07:55 PM4/6/09
to Pisa XHTML2PDF Support
I've read the documentation regarding frames (though I don't
understand what a frame is in PDF lingo). What I would like to do is
have a footer that only shows up on the last page of my document.
However, my document is not a fixed number of pages. It is a report
that could be 1 page or 14 pages. How do I take advantage of the
lastPage feature as displayed in the docs?

--

@page lastPage {
top: 1cm;
left: 2cm;
right: 2cm;
height: 2cm;
@frame middle {
margin: 3cm;
}
@frame footer {
bottom: 2cm;
margin-left: 1cm;
margin-right: 1cm;
height: 1cm;
}
}

Thanks for your help!

Tim

unread,
Apr 7, 2009, 8:52:11 AM4/7/09
to Pisa XHTML2PDF Support
For those reading, I jerry-rigged a solution together with pyPDF. The
solution is to leave a blank space on all pages for the footer and
print the footer on the last page by itself. Then use pyPDF to merge
the two last pages into one. I wish there was a better solution, but
this will meet the deadline.

-tim

Dirk Holtwick

unread,
May 4, 2009, 5:05:18 AM5/4/09
to xhtm...@googlegroups.com
Tim,

I think your pyPdf solution is ok, because I don't see to set a template
conditionally for the last page. If you explicitly create a the last
page you could do something like this:

<pdf:nextpage template='lastPage' />

Dirk

Tim schrieb:

Aidan Doherty

unread,
Apr 22, 2016, 10:18:32 AM4/22/16
to Pisa XHTML2PDF Support
Hi 

Just came across this seems after 7 years its still hard to find a solid solution but i dont think pyPDF is supported or used anyway, So did anyone ever find another way to solve this ??

cheers 

Aidan
Reply all
Reply to author
Forward
0 new messages