Paulo


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Srinivas P
Sent: Friday, May 19, 2006 3:03 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] Image not adding to header

Hi,

I want to add an image to header by using HeaderFooter class, I tried with the below code

 Document document = new Document(PageSize.A4, 50, 50, 50, 50);

 PdfWriter.getInstance( document , new FileOutputStream("text.pdf"));

 document.addAuthor("Bruno Lowagie");

 document.addSubject("This is the result of a Test.");

 Image image= Image.getInstance("c:/test/tntlogo.gif");

 Chunk chunk = new Chunk(image,0,-1);

 HeaderFooter header = new  HeaderFooter(new Phrase(chunk), true);

 HeaderFooter footer = new HeaderFooter(new Phrase("_"), false);

 footer.setAlignment(Element.ALIGN_BOTTOM);

 document.setHeader(header);

 document.setFooter(footer); // we open the document for

 document.open();

  String text = "some padding text ";

         for (int k = 0; k < 10; ++k)

             text += text;

         Paragraph p = new Paragraph(text);

         p.setAlignment(Element.ALIGN_JUSTIFIED);

         document.add(p);

document.close();

The image is not adding to the PDF, what might be the problem, can any one please help me out

Thanks

Srinivas



“The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It may contain confidential or legally privileged information and may not be disclosed to anyone else. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to the sender of this email and then delete it from your system. Four Soft is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt”.


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.

Reply via email to