Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jul 04, 2019 8:40 pm

Hello I'm appending a RFT text to a Word File, but some characters are not visible, this characters contains a tilde like: áéíóú ÁÉÍÓÚ.
And the text into the document aren't visible.
Can you help me.
Thank you

arturo.garcia
 
Posts: 2
Joined: Thu Jul 04, 2019 8:29 pm

Fri Jul 05, 2019 2:13 am

Hello,

Thank you for contacting.
After an initial test with our latest Spire.Doc Pack(hot fix) Version:7.6.16, I found that the characters (áéíóú ÁÉÍÓÚ) are visible in my generated Word document like the attachment. Below is my testing code for your reference. Thus, I suggest that you firstly try again with the latest version, if your issue still exists or your testing code is different from mine, please share us with your testing code as well as your output Word file for further look into it. You could send them to us via email ([email protected]).
Code: Select all
Document doc = new Document();
Section section = doc.AddSection();
Paragraph para = section.AddParagraph();
String rtfString = @"{\rtf1\ansi\deff0 {\fonttbl {\f0 hakuyoxingshu7000;}}\f0\fs28 áéíóú ÁÉÍÓÚ}";
para.AppendRTF(rtfString);
doc.SaveToFile("Output.docx");

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Fri Jul 05, 2019 3:07 pm

Hey Lisa

Thank you so much for your answer, you have the reason using this version I can get the tildes, but my RTF document included the characters with tilde in other format, my solution was do a replacement with this method, and now it's working:

Code: Select all
 public string TildeReplacement(string Text)
        {
            Text = Text.Replace("\\`e1", "á");
            Text = Text.Replace("\\`c1", "Á");
            Text = Text.Replace("\\`e9", "é");
            Text = Text.Replace("\\`c9", "É");
            Text = Text.Replace("\\`ed", "í");
            Text = Text.Replace("\\`cd", "Í");
            Text = Text.Replace("\\`f3", "ó");
            Text = Text.Replace("\\`d3", "Ó");
            Text = Text.Replace("\\`fa", "ú");
            Text = Text.Replace("\\`da", "Ú");
            Text = Text.Replace("\\`fc", "ü");
            Text = Text.Replace("\\`dc", "Ü");
            Text = Text.Replace("\\`f1", "ñ");
            Text = Text.Replace("\\`d1", "Ñ");
            return Text;
        }


Thank you for your attention.
Greetings. Arthur.

arturo.garcia
 
Posts: 2
Joined: Thu Jul 04, 2019 8:29 pm

Mon Jul 08, 2019 1:32 am

Hello,

Glad to hear that your issue has been resolved! If you encounter any issue related to our products in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron