Bruno Lowagie escribió:
dafernan wrote:
I'm quite new to iText and found the same issue.
I've tried to use the approach of wrapping the PdfTemplate inside an Image,
but it doesn't work for me.
It's as easy for me to say 'it works for me',
as it is for you to say 'it doesn't work'.
So please be more specific, saying 'it doesn't work'
is not very respectful, especially if you're not saying
what it is you want to work.
Sorry, I thought that what I want to do was clear from the original
title of the thread ("Page numbers in tables in footers in PDFs"), but
it seems it isn´t.
What I have done is to create a template as it is done in
PageNumbersWatermark example:
public void onCloseDocument(PdfWriter writer, Document document) {
tpl.beginText();
tpl.setFontAndSize(helv, 12);
tpl.setTextMatrix(0, 0);
tpl.showText("" + (writer.getPageNumber() - 1));
tpl.endText();
}
In onEndPage() method, instead of adding template to ContentByte, what I
want is to add it to a table cell, so what I have done is:
Image img = Image.getInstance(tpl);
PdfPCell cell = new PdfPCell(img);
But nothing is shown in the cell, so I don't know if I'm doing something
wrong.
Regarding this issue, I'm not sure how I could add to the image at the
beginning the text "Page X of", where X is the current page.
Not sure how it could be done through CellEvent.
Could you put a piece of code showing how both alternatives looked like?
As you are not telling us what you want to achieve,
the only thing I can do is to refer you to the book
because I'm 99% sure the answer is in there somewhere.
I could give a more specific answer if the question
was more specific, but... it isn't, and I have to
go to work in a minute.
Same problem as commented before, adding total number of pages in a
table in footer.
You told about an alternative solution based on CellEvent, but I haven't
figured out how to do it, so any help on this issue would be welcome.
br,
Daniel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/