Hi all,

 

 

I have an image for my header and footer. The problem I am having is
that there is no spacing between the start of the page and the image.

 

I have tried using 

 

header.setSpacingBefore() for the PdfPTable that I am using to attach
header but I don't seem to get it (see attached).

 

Below is a portion of the code

 

 

            Image header = Image.getInstance(strFontsDirectory
+"bizcallheader.gif");

            header.scalePercent(90);

            Image footer = Image.getInstance(strFontsDirectory
+"bizcall_footer.gif");

            footer.scalePercent(60);

            PdfPTable  head = new PdfPTable(1);

           cell = new PdfPCell(header);

           cell.setBorderColor(Color.white)  ;

           head.addCell(cell);

           head.setSpacingBefore(100);

           head.setSpacingAfter(100);

         Rectangle page = document.getPageSize();

         head.setTotalWidth(page.width() - document.leftMargin() -
document.rightMargin());

         head.writeSelectedRows(0, -1, document.leftMargin(),
page.height() - document.topMargin() + head.getTotalHeight(),
writer.getDirectContent());

        

         PdfPTable foot      = new PdfPTable(1);

         PdfPCell footerCell = new PdfPCell(footer);

         footerCell.setPaddingTop(10);

         footerCell.setPaddingBottom(10);

         footerCell.setBorderColor(Color.white);

         footerCell.setHorizontalAlignment(Element.ALIGN_CENTER);

         foot.addCell(footerCell);

         foot.setSpacingBefore(80);

         foot.setSpacingAfter(40);

         foot.setTotalWidth(page.width() - document.leftMargin() -
document.rightMargin());

 

 

 

The other problem is I have text going into my footer and not going to
the next page when it 'hits' the footer area.

 

 

Please assist.

Attachment: 0607QuoteQ589.2.pdf
Description: 0607QuoteQ589.2.pdf

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to