Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Aug 17, 2022 2:22 pm

Hello!

I'm trying to save presentation with text added as HTML, using AddFromHtml method.

But I get The surrogate pair is invalid, when trying to save Spanish text.
Could you help me solve this issue ?

Here is the full stack trace:
Code: Select all
System.ArgumentException: The surrogate pair (0xD835, 0x2E) is invalid. A high surrogate character (0xD800 - 0xDBFF) must always be paired with a low surrogate character (0xDC00 - 0xDFFF).
   at System.Xml.XmlTextEncoder.WriteSurrogateChar(Char lowChar, Char highChar)
   at System.Xml.XmlTextEncoder.Write(String text)
   at System.Xml.XmlTextWriter.WriteString(String text)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
   at System.Xml.XmlElement.WriteTo(XmlWriter w)
   at System.Xml.XmlDocument.WriteContentTo(XmlWriter xw)
   at spr᝚.ᜀ(sprᢻ A_0, Stream A_1, XmlDocument A_2)
   at spr᝚.ᜀ(sprᢻ A_0, sprᜫ A_1)
   at spr᝚.ᜀ(Stream A_0, sprᜫ A_1, spr᧸ A_2)
   at spr᝚.ᜀ(Stream A_0, spr᧳ A_1, spr᧴ A_2)
   at spr᝚.ᜀ(Stream A_0, spr᧳ A_1)
   at Spire.Presentation.Presentation.SaveToFile(Stream stream, FileFormat fileFormat)

yarchiT2022
 
Posts: 5
Joined: Wed Jun 29, 2022 6:52 pm

Thu Aug 18, 2022 5:41 am

Hello,

Thanks for your inquiry.
Are you using the latest version of Spire.Presentation 7.8.0? If not, please update to the latest version and have a test. If the issue still exists, to help us reproduce your issue and work out a solution for you, please offer the following message, thanks for your assistance in advance.

1) Your test code.
2) Your input PPT file.
3) Application type, such as Console App, .NET Framework 4.8.
4) Your test environment, such as OS info (E.g. Windows 7, 64-bit, RAM 8G) and region setting (E.g. China, Chinese).

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 949
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Presentation