|
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
|
- [iText-questions] Problems with Rtf ... Raja_Banerjee
- Re: [iText-questions] Problems with Rtf ... Mark Hall
- RE: [iText-questions] Problems with Rtf ... Raja_Banerjee
- Re: [iText-questions] Problems with Rtf ... Mark Hall
