Hi Mark,

I have been able to add a table with images and text in the header, as following-

 

Table headerTable = new Table(3);

                                    headerTable.addCell("    ABC Ltd ");

 

                                    Cell pageNumberCell = new Cell();

                                    Image img1 = Image.getInstance("img1.jpg");

                                    pageNumberCell.add(img1);

                                    pageNumberCell.add(new RtfPageNumber());

                                    pageNumberCell.add(new Chunk(" of "));

                                    pageNumberCell.add(new RtfTotalPageNumber());

                                    Image img2 = Image.getInstance("img2.jpg");

                                    pageNumberCell.add(img2);

                                    pageNumberCell.setHorizontalAlignment(Element.ALIGN_CENTER);

                                    headerTable.addCell(pageNumberCell);

                                   

                                    headerTable.addCell("       XYZ Inc.");

                                    headerTable.setAlignment(Element.ALIGN_CENTER);

                                   

                                    RtfHeaderFooter hf = new RtfHeaderFooter(headerTable);

                                    hf.setAlignment(Element.ALIGN_CENTER);

                                    doc.setHeader(hf);

 

 

But when I am trying to replicate the same in footer, ie. doc.setFooter(hf) , I get nothing in the footer.

Basically, I need “Page m of n” kind of  thing only in the footer, right-aligned.

 

Also something is wrong with- Element.ALIGN_RIGHT etc… not working as in-

 

RtfHeaderFooterGroup footer = new RtfHeaderFooterGroup();

                                    footer.setHeaderFooter(

                                                new RtfHeaderFooter(

                                                            new Phrase("This is the footer on the title page.")),

                                                RtfHeaderFooter.DISPLAY_FIRST_PAGE);

                                    footer.setAlignment(Element.ALIGN_CENTER);

 

                                    footer.setHeaderFooter(

                                                new RtfHeaderFooter(new Phrase("Footer for other pages.")),

                                                RtfHeaderFooter.DISPLAY_ALL_PAGES);

                                    footer.setAlignment(Element.ALIGN_RIGHT);

                                    doc.setFooter(footer);

 

All footers are set left-aligned in the document, irrespective of alignment set.

 

For doc.setMargins(1,2,3,4) , tell me which value is for top, bottom, left and right margins?

 

How to add two lines , one above other, right-aligned in the header?

 

Please help me out. Hope you will reply soon.

 

Thanks in advance,

 

Regards,

~Raja

Bhubaneswar

 

 

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Reply via email to