Results 1 to 3 of 3

Thread: [RESOLVED] Change Paragraph Font using ItextSharp

Threaded View

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Resolved [RESOLVED] Change Paragraph Font using ItextSharp

    I have tried many examples found from Google without a lot of luck.

    I have below but cannot implement without getting "System.InvalidCastException: 'Conversion from string "Report by: Some Text" to type 'Integer' is not valid.'" and do not understand why it is wanting to convert to Integer.

    ERROR ON THIS LINE:
    Code:
     pdfParagraph.Add("Report by: Some Text", Ffont)
    Code:
     Dim pdfFont As BaseFont = BaseFont.CreateFont("c:\windows\fonts\Arial.ttf", BaseFont.IDENTITY_H, True)
            Dim Ffont As New iTextSharp.text.Font(pdfFont, 8, iTextSharp.text.Font.NORMAL)
            'pdfParagraph.Add(Ffont)
            'Dim pdfFont As iTextSharp.text.Font = New Font(FontFactory.GetFont(FontFactory.TIMES_ROMAN, 8.0F, Font.Bold, BaseColor.BLACK))
            pdfParagraph.Add("Report by: Some Text", Ffont)
            pdfDoc.Add(pdfParagraph)
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width