Hi,

you have to add the footer content with the class ColumnText in simulation 
mode (check http://itextpdf.com/themes/keywords.php#C). This has to be 
done before adding the other content above the footer to the page 
(onEndPage method is too late). With this tool you know how much space is 
needed for your footer (set the column coordinates with respect to the 
document margin, add content with simulation mode and check if all the 
text could be added). If the footer could not be added completely, 
increase column size. If the footer could be added completely, add the 
other page content above the footer coordinates and add the footer with 
the coordinates that fitted before. 

I think this could work. Hopefully I didn't forget anything.

A different approch would be to add the whole content to the footer table 
before entering onEndPage, get the height of the table and add the other 
content above the footer table. I don't know if the height of the table is 
available directly.

Best regards
Benjamin



Von:    dpmihai <[email protected]>
An:     [email protected]
Datum:  23.01.2012 17:04
Betreff:        [iText-questions] Pdf Table footer and bottom margin



Hello.

I have a Document created with LEFT, RIGHT, TOP and BOTTOM margins and a
dynamic footer which I construct like a PdfPTable on PdfPageEventHelper:

    public void onEndPage(PdfWriter writer, Document document) {
                ....
                         PdfPTable footer = createMyFooterTable(); 

                Rectangle page = document.getPageSize();  
                         footer.setTotalWidth(page.getWidth() - 
document.leftMargin() -
document.rightMargin());
                         footer.writeSelectedRows(0, -1, 
document.leftMargin(), 
                        document.bottomMargin() ,
writer.getDirectContent());
                         }
                ......


My footer table can have any number of rows. I do not know how to set the
bottom margin because I also want the footer to take bottom margin into
account (not just the document).
If I use like in previous code to write at Y = document.bottomMargin(), I 
do
not have the footer with a bottom Margin and also not all the footer will 
be
printed is there are more rows inside it.

I think I have to compute my footer table height , lets call it FH, I have
to create my document with new Document( ..., BOTTOM + FH), and write 
footer
table at Y = document.bottomMargin() + BOTTOM + FH.

Is this the solution? How to know FH before creating the document?

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Pdf-Table-footer-and-bottom-margin-tp4321110p4321110.html

Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a 
reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php






____________________________________________________________________

Viessmann IT Service GmbH
Geschäftsführer: Dirk Klöckner, Dr. Harald Dörnbach
Sitz der Gesellschaft: Allendorf (Eder) - Registergericht: 
AG Marburg (Lahn) - HRB 5324 - USt-IdNr.: DE258558424
____________________________________________________________________
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to