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.

Tue Aug 08, 2023 10:35 am

以下是一段html
<table style="width:auto;"><tbody><tr><th colSpan="1" rowSpan="1" width="auto"></th></tr></tbody></table><p><br></p>
调用AddFromHtml方法报错
can't parse coordinate

yabozhao
 
Posts: 26
Joined: Sat Jul 22, 2023 1:44 am

Wed Aug 09, 2023 3:36 am

您好,

感谢您的反馈。
我使用最新版本的Spire.Presentation 8.7.2 hotfix, 以及如下的代码进行测试
Code: Select all
Presentation ppt = new Presentation();
IAutoShape shape = ppt.Slides[0].Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(50, 50, 400, 100));
shape.TextFrame.Paragraphs.Clear();

string htmlText1 = "<table style=\"width:auto;\"><tbody><tr><th colSpan=\"1\" rowSpan=\"1\" width=\"auto\"></th></tr></tbody></table><p><br></p>";
string htmlText2 = "<p><span style=\"color:rgb(225,60,57);\">aaaaa</span></p>";

shape.TextFrame.Paragraphs.AddFromHtml(htmlText1);
shape.TextFrame.Paragraphs.AddFromHtml(htmlText2);

ppt.SaveToFile("output.pptx", FileFormat.Pptx2013);



但是并没有复现您提出的问题,如果您不是使用的最新版,您可以下载然后测试。如果测试后还有问题,麻烦您提供一下您的完整测试代码以及项目信息。感谢您的帮助与支持。

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Presentation

cron