We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Text Alignment Problem in Aspose.slides Texframe in PPTX class

Hi Team,

Not able set vertical Text Alignment to center in the text frame in PPTX class,however the AnchorText property for Texframe in PPT class works .


TextFrameEx tf = tbl[col, row].TextFrame;

ParagraphEx par = tf.Paragraphs[0];

par.ParagraphFormat.Alignment = TextAlignmentEx.Center;

Version of Aspose.slides.dll is

Hi Kapil,

Thanks for inquiring Aspose.Slides.

I like to suggest you to please try using Aspose.Slides for .NET 7.1.0 on your end and if there is still an issue then please share the complete sample application along with generated presentation to reproduce the issue.

Many Thanks,

Hi team,

Not able to set vertical alignment for the Textframe in dot 4.0 :

TextFrameEx tf = tbl[col, row].TextFrame;


version of Aspose.slides dll :

Please provide the solution for vertical alignment of text in Texframe.

Hi Kapil,

Please use the following sample code to serve the purpose. Please share, if I may help you further in this regard.

public static void verticleAlignText()
//Instantiate PresentationEx
PresentationEx pres = new PresentationEx();

//Get the first slide
SlideEx sld = pres.Slides[0];

//Add an AutoShape of Rectangle type
int idx = sld.Shapes.AddAutoShape(ShapeTypeEx.Rectangle, 150, 75, 250, 250);
AutoShapeEx ashp = (AutoShapeEx)sld.Shapes[idx];

//Add TextFrame to the Rectangle
ashp.AddTextFrame(“Aspose TextBox”);

TextFrameEx txt = ashp.TextFrame;

txt.AnchoringType = TextAnchorTypeEx.Center;
txt.TextVerticalType = TextVerticalTypeEx.Vertical;

//Write the presentation to disk
pres.Write(“d:\Aspose Data\TextBox.pptx”);


If there is still an issue then kindly share the desired output presentation and I will try to help you further.

Many Thanks,