I have an ASP.NET 2.0 app using VB to create a PDF document using the API. I can not find any documentation which shows me how to write a line that contains both bold and non-bold text. All the documentation I see so far only show you how to write bolded text and non-bolded text on separate lines. Please help.
You can use multiple segments to attain your goal. Please refer to the following code:
Dim pdf1 As New Pdf()
Dim sec As Section = pdf1.Sections.Add()
Dim text As New Text()
sec.Paragraphs.Add(text)
Dim segment2 As Segment = text.Segments.Add("This is Bold ")
segment2.TextInfo.FontSize = 20
segment2.TextInfo.FontName = “Arial”
segment2.TextInfo.IsTrueTypeFontBold = True
Dim segment1 As Segment = text.Segments.Add("This is not Bold ")
segment1.TextInfo.FontSize = 20
segment1.TextInfo.FontName = “Arial”
pdf1.Save(“E:/AsposeTest/Bold.pdf”)
If you need more help, please do let us know.
Thanks.
Adeel Ahmad
Support Developer
Aspose Changsha Team