为有中文需求的客户提供多渠道中文技术支持.

Mon Nov 17, 2025 7:17 am

目前測試 Spire.Presentation 也是 插入空白加底線無顯示
想請問有無為尾部空格添加底線參數

範例如下

Code: Select all
        Spire.Presentation.Presentation ppt = new Spire.Presentation.Presentation();
        Spire.Presentation.ISlide slide = ppt.Slides[0];
        Spire.Presentation.IAutoShape shape = slide.Shapes.AppendShape(Spire.Presentation.ShapeType.Rectangle, new RectangleF(100, 100, 400, 80));
        shape.Fill.FillType = FillFormatType.None;
        shape.Line.FillType = FillFormatType.None;
        var para = new Spire.Presentation.TextParagraph();
        string text = "(6)   ";
        Spire.Presentation.TextRange range = new Spire.Presentation.TextRange(text);
        range.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
        range.Fill.SolidColor.Color = Color.Black;
        range.TextUnderlineType = Spire.Presentation.TextUnderlineType.Single;
        para.TextRanges.Append(range);
        shape.TextFrame.Paragraphs.Append(para);
        ppt.SaveToFile("output.pptx", Spire.Presentation.FileFormat.Pptx2013);

NaniBook
 
Posts: 14
Joined: Mon Sep 15, 2025 1:53 am

Mon Nov 17, 2025 9:29 am

您好,

感謝您的諮詢。關於PowerPoint文檔,無論是微軟的Office還是WPS辦公軟件,都沒有提供相關屬性可以進行設置。目前我們的產品也暫未開放相關屬性的接口設定。
目前代码雖然尾部空格被設置了下劃線樣式,但由於軟件工具本身不支持,無法顯示出相應的效果。建議您在內容設置上,是否可以考虑避免以空格結尾的情況。例如,考慮使用類似 (string text = "(6)   ;") 的方式來替代。

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Mon Nov 17, 2025 10:21 am

感謝回覆!

NaniBook
 
Posts: 14
Joined: Mon Sep 15, 2025 1:53 am

Return to 中文技术支持