Footer Table Problem in existing pdf

UI Components for JSF
Post Reply
ramesh.s
Posts: 2
Joined: 10 Mar 2011, 09:02

26 May 2011, 11:09

Hi all,

I am adding table to the header with image to the existing pdf .Same thing i need to do for pdf footer also but , I dont know how to do this(for footer).Can any one helpm me.

public void preProcessPDF(Object document) throws IOException, BadElementException, DocumentException {
Document pdf = (Document) document;
pdf.open();

Font style = new Font(Font.TIMES_ROMAN, 12,Font.BOLD);
String imageUrl= "C:\\Documents and Settings\\dev1\\Desktop\\img.jpg";

PdfPTable header = new PdfPTable(1);

Image image=Image.getInstance(imageUrl);
image.scaleAbsolute(418f,90f);

PdfPCell cell =new PdfPCell(image);
header.addCell(cell);

PdfPCell cell1 =new PdfPCell(new Paragraph("Name Report",style));
cell1.setHorizontalAlignment(cell1.ALIGN_CENTER);

header.addCell(cell1);

pdf.add(header);
}

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests