itextsharp and Multiple Font types in a Table Cell

Discussion in 'ASP .Net' started by Hawksey, Aug 23, 2006.

  1. Hawksey

    Hawksey Guest

    Hello

    I have just started messing with the itextsharp component and was
    wondering if it was possible to add two concatenated phrases each with
    a different font type to a a table cell

    eg
    ############################
    Dim pdfCell As Cell
    Dim phFirst As Phrase
    Dim phSecond As Phrase
    Dim fntNormalText As Font = FontFactory.GetFont(FontFactory.HELVETICA,
    12, Font.NORMAL)
    Dim fntBoldText As Font = FontFactory.GetFont(FontFactory.HELVETICA,
    12, Font.BOLD)

    phFirst = New Phrase(("Name:", fntBoldText)
    phSecond = New Phrase(strFirstName & " " & strSurname, fntNormalText)
    pdfCell = New Cell(phFirst & phSecond)
    ##################################

    The above doesn't work, but I was hoping someone could point me in the
    right direction to accomplish the task.

    Many thanks
    Paul
     
    Hawksey, Aug 23, 2006
    #1
    1. Advertisements

  2. Hawksey

    Hawksey Guest

    Managed to sort this out.

    If anyone is interested.
    #############################################
    Dim phFirst As Phrase
    Dim phSecond As Phrase
    Dim para As Paragraph = New Paragraph
    Dim fntNormalText As Font =
    FontFactory.GetFont(FontFactory.HELVETICA,
    12, Font.NORMAL)
    Dim fntBoldText As Font =
    FontFactory.GetFont(FontFactory.HELVETICA,
    12, Font.BOLD)

    phFirst = New Phrase("Name:", fntTRSBoldText)
    phSecond = New Phrase(strFirstName & " " & strSurname,
    fntTRSNormalText)
    para.Add(phFirst)
    para.Add(phSecond)
    pdfCell = New Cell(para)
    ##################################################
     
    Hawksey, Aug 23, 2006
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. coleenholley
    Replies:
    5
    Views:
    1,519
    coleenholley
    Jan 21, 2004
  2. =?Utf-8?B?U2Vhbg==?=

    Using itextsharp to generate pdf from asp.net

    =?Utf-8?B?U2Vhbg==?=, Feb 10, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    41,209
    mfreidge
    Jul 16, 2008
  3. Nique
    Replies:
    0
    Views:
    964
    Nique
    Aug 17, 2004
  4. Patrick Olurotimi Ige

    using itextsharp assembly with asp.net?

    Patrick Olurotimi Ige, Mar 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,715
    Brian Munroe
    Mar 23, 2005
  5. news.rcn.com
    Replies:
    1
    Views:
    10,199
    Chris Smith
    Jul 12, 2004
  6. Phillip Roncoroni
    Replies:
    14
    Views:
    1,362
    Toby A Inkster
    Apr 5, 2004
  7. mttc
    Replies:
    2
    Views:
    2,677
    Roedy Green
    Jul 3, 2009
  8. Tina dan
    Replies:
    0
    Views:
    566
    Tina dan
    Sep 28, 2012
Loading...