Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed May 14, 2014 7:08 am

I create a document where i insert a table and a couple of rows and cells and then some text. If i set the font to be Italic, and the text contains german characters such as ä, ö, ü,ß, §, the text will not be rendered as italic anymore. This happens only if the document is exported as PDF, and with other fonts than Arial, i tried with Tahoma and the font is not rendered as italic.

Here is my code example:

Code: Select all
 Dim doc As New Document()
        Dim s As Section = doc.AddSection()
        Dim t As Spire.Doc.Table = s.AddTable(True)

        Dim r As Spire.Doc.TableRow = t.AddRow()
        For i As Integer = 0 To 3
            Dim c As Spire.Doc.TableCell = r.AddCell()
            c.AddParagraph().AppendText("94 USt §13b 16%")
            Dim txtRange As TextRange = CType(c.Paragraphs(0).ChildObjects(0), TextRange)
            txtRange.CharacterFormat.Italic = True
            txtRange.CharacterFormat.FontName = "Tahoma"
        Next

        Dim r1 As Spire.Doc.TableRow = t.AddRow()
        For i As Integer = 0 To 3
            Dim c As Spire.Doc.TableCell = r1.Cells(i)
            c.AddParagraph().AppendText("bbbbbbbbb")
        Next
        Dim r2 As Spire.Doc.TableRow = t.AddRow()
        For i As Integer = 0 To 3
            Dim c As Spire.Doc.TableCell = r2.Cells(i)
            c.AddParagraph().AppendText("umläutearungasdfn adsfnasd asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf")
            Dim txtRange As TextRange = CType(c.Paragraphs(0).ChildObjects(0), TextRange)
            txtRange.CharacterFormat.Italic = True
            txtRange.CharacterFormat.FontName = "Tahoma"
        Next
        doc.SaveToFile("C:\test.pdf", FileFormat.PDF)
        doc.Close()

catalin
 
Posts: 48
Joined: Wed Mar 14, 2012 12:56 pm

Wed May 14, 2014 8:23 am

Hello,

Thanks for your feedback.
If there are special symbol in the word such as ä, ö, ü,ß, §,etc, when be converted to the PDF, it needs to embed the font into the PDF, so you have to install the Tahoma Itatic font in your system.
If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu May 15, 2014 5:57 am

Ok, now its clear, thanks for the answer

catalin
 
Posts: 48
Joined: Wed Mar 14, 2012 12:56 pm

Thu May 15, 2014 6:09 am

Thanks for your response. If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Doc