How to get/set Vertical align text inside a recatangle

“How can I vertical align - top/middle/bottom align- contents inside a Rectangle shape?”

I find that in the feedback example from URL(Highlight Text- Vertical align- hide table border- fit text to shape - #3 by msabir - Free Support Forum - aspose.com)
aspose can’t set vertical align to top directly, and it can only achieve this by setting margin-top to zero.



Is it possible to get/set the vertical align information from the textframe(or other Obbect)

Thank you!

Hi
Anne,


I have tried to understand the issue shared by you but unfortunately have not been able to completely understand. Can you please kindly share your requirements in detail along with the presentation that is highlighting your requirements.

Many Thanks,

Hi Mudassir,

I've uploaded a docx(with a picture) to explain my problem.

I'm not sure whether aspose can extract that "Align Text " attributes from ppt or not.

Thank you!

Hi,


I am sorry for the delayed response. Please use the code snippet given below to serve the purpose of your requirements. Please share if I may help you further in this regard.

Presentation pres = new Presentation();

Slide slide = pres.addEmptySlide();

com.aspose.slides.Rectangle rect = slide.getShapes ().addRectangle(300, 400, 1700, 1600);

com.aspose.slides.TextFrame tf = rect.addTextFrame(“Hellow World”);
//foreach (Aspose.Slides.Paragraph p in tf.Paragraphs)
com.aspose.slides.Paragraph para=tf.getParagraphs().get (0);

para.setAlignment(com.aspose.slides.TextAlignment.CENTER);
// tf.AnchorText = Aspose.Slides.AnchorText.TopCentered;

tf.setAnchorText(com.aspose.slides.AnchorText.MIDDLE);
tf.setWrapText(true);


pres.write(“D:\Aspose Data\TextAlign.ppt”);


Many Thanks,