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

Free Support Forum - aspose.com

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(http://www.aspose.com/community/forums/216818/highlight-text-vertical-align-hide-table-border-fit-text-to-shape/showthread.aspx#216818)
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,