Hi All,

 

 

I tried to add my footer table which contains company's image and some text about company which needs to printed only at the bottom like  border of last page. I tried to do using PdfPageeventHelper but it didn't help me much.

 

Below is the way I tried.

 

where printFooter is boolean variable available to both the code adding elements to the body of the PDF and to the onEndPage event handler.printFooter is true only at the end of document before we close it.

 

OnStartPage

                                    Table footertable = helper.getFooterTable(path);

                                                if(writer.fitsPage(footertable))

                                                            printFooter = true;

                                                else

                                                printFooter = false;

 

OnEndPage

                        if(printFooter)

                        {

                                    printFooter = false;

                       

                                                Table footertable = helper.getFooterTable(path);

                                                if(!writer.fitsPage(footertable)) {

                                                            document.newPage();

                                                }

 

            } 

 

Above code is printing my table at the beginning of page not at the end.

Here are conditions

  1. when page1 is full it should push table to end of  page2
  2. when page1 is written till middle of page it should print table at the end of page1

 

Can anyone please help me ?

Thanks Kiers . Based on your suggestion I tried above  way

 

Thanks

Suneetha

 

 

 

 

Reply via email to