Need to display the page number as "2" from second page Onwards. [modified]
-
Hi all, I am generating word document using iTextdotnet.dll.As per my requirement i need to display the page number as "2" from second page Onwards. And also is it possible to decrease font size of header from second page onwards???? So i need to hide page number "1" for first page. i calling the following the following method in layers. public com.lowagie.text.HeaderFooter HeaderForReport() { string emptypath = string.Empty; int colspan0 = 0; int colspan1 = 1; int colspan2 = 2; int colspan3 = 3; int colspan4 = 4; int colspan5 = 5; com.lowagie.text.Font ReportHeaderFont1 = new com.lowagie.text.Font(FontFactory.getFont(FontFactory.HELVETICA_BOLD, 24, com.lowagie.text.Font.BOLD, GDI.Color.Black)); com.lowagie.text.Font fontNormal = new com.lowagie.text.Font(FontFactory.getFont(com.lowagie.text.FontFactory.HELVETICA, 10, com.lowagie.text.Font.NORMAL, GDI.Color.Black)); com.lowagie.text.Chunk cktext = new com.lowagie.text.Chunk("\nStudio BOLTON e Associati S.r.l.", com.lowagie.text.FontFactory.getFont(FontFactory.TIMES_BOLD, 24, com.lowagie.text.Font.BOLD | com.lowagie.text.Font.UNDERLINE, GDI.Color.FromArgb(128, 128, 192))); com.lowagie.text.Chunk ck = new com.lowagie.text.Chunk("\n\nSpecialist Adjusters / Perizie Assicurative - Rischi Speciali", com.lowagie.text.FontFactory.getFont(FontFactory.TIMES_BOLD , 10, com.lowagie.text.Font.ITALIC , GDI.Color.Black)); com.lowagie.text.Phrase p2 = new Phrase(); p2.add(cktext); p2.add(ck); p2.add(Space(5)); HeaderFooter header = new HeaderFooter(p2, true); header.setAlignment(100); header.setAlignment(ElementConst.ALIGN_LEFT); header.setBorder(com.lowagie.text.Rectangle.NO_BORDER); return header; } Output --------- Studio BOLTON e Associati S.r.l. -------------------------------------------------- Specialist Adjusters / Perizie Assicurative - Rischi Speciali 1 This is first page header. Studio BOLTON e Associati S.r.l. ----------------------------------------------------- Specialist Adjusters / Perizie Assicurative - Rischi Speciali 2 This is the second page header ================================================== But i need the result as follows. Studio BOLTON e Associati S.r.l. ----------------------------------------------------- Specialist Adjusters / Perizie Assicurative - Rischi Speciali (First page page number 1 should not display) The second page header should be like below . Stud
-
Hi all, I am generating word document using iTextdotnet.dll.As per my requirement i need to display the page number as "2" from second page Onwards. And also is it possible to decrease font size of header from second page onwards???? So i need to hide page number "1" for first page. i calling the following the following method in layers. public com.lowagie.text.HeaderFooter HeaderForReport() { string emptypath = string.Empty; int colspan0 = 0; int colspan1 = 1; int colspan2 = 2; int colspan3 = 3; int colspan4 = 4; int colspan5 = 5; com.lowagie.text.Font ReportHeaderFont1 = new com.lowagie.text.Font(FontFactory.getFont(FontFactory.HELVETICA_BOLD, 24, com.lowagie.text.Font.BOLD, GDI.Color.Black)); com.lowagie.text.Font fontNormal = new com.lowagie.text.Font(FontFactory.getFont(com.lowagie.text.FontFactory.HELVETICA, 10, com.lowagie.text.Font.NORMAL, GDI.Color.Black)); com.lowagie.text.Chunk cktext = new com.lowagie.text.Chunk("\nStudio BOLTON e Associati S.r.l.", com.lowagie.text.FontFactory.getFont(FontFactory.TIMES_BOLD, 24, com.lowagie.text.Font.BOLD | com.lowagie.text.Font.UNDERLINE, GDI.Color.FromArgb(128, 128, 192))); com.lowagie.text.Chunk ck = new com.lowagie.text.Chunk("\n\nSpecialist Adjusters / Perizie Assicurative - Rischi Speciali", com.lowagie.text.FontFactory.getFont(FontFactory.TIMES_BOLD , 10, com.lowagie.text.Font.ITALIC , GDI.Color.Black)); com.lowagie.text.Phrase p2 = new Phrase(); p2.add(cktext); p2.add(ck); p2.add(Space(5)); HeaderFooter header = new HeaderFooter(p2, true); header.setAlignment(100); header.setAlignment(ElementConst.ALIGN_LEFT); header.setBorder(com.lowagie.text.Rectangle.NO_BORDER); return header; } Output --------- Studio BOLTON e Associati S.r.l. -------------------------------------------------- Specialist Adjusters / Perizie Assicurative - Rischi Speciali 1 This is first page header. Studio BOLTON e Associati S.r.l. ----------------------------------------------------- Specialist Adjusters / Perizie Assicurative - Rischi Speciali 2 This is the second page header ================================================== But i need the result as follows. Studio BOLTON e Associati S.r.l. ----------------------------------------------------- Specialist Adjusters / Perizie Assicurative - Rischi Speciali (First page page number 1 should not display) The second page header should be like below . Stud
This has been stated quite a few times, format your code (using the pre tags) or it will just get ignored.
I know the language. I've read a book. - _Madmatt