Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Need to display the page number as "2" from second page Onwards. [modified]

Need to display the page number as "2" from second page Onwards. [modified]

Scheduled Pinned Locked Moved C#
comgraphicsquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    attalurisubbu
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • A attalurisubbu

      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

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups