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.

Mon May 22, 2017 10:37 am

I want to add a superscript and subscript, so how to add the same.

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Tue May 23, 2017 3:49 am

Dear stp_webdev,

Thanks for your inquiry.
Here is sample code for your kind reference.
Code: Select all
            TextRange tr = new TextRange("superscript");
            shape.TextFrame.Paragraphs[0].TextRanges.Append(tr);
            //superscript
            shape.TextFrame.Paragraphs[0].TextRanges[1].Format.ScriptDistance = 30;
            shape.TextFrame.Paragraphs[0].TextRanges[1].Fill.FillType = FillFormatType.Solid;
            shape.TextFrame.Paragraphs[0].TextRanges[1].Fill.SolidColor.Color = Color.Black;
            //shape.TextFrame.Paragraphs[0].TextRanges[5].Format.ScriptDistance = -25; Subscript

If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Presentation