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

Thu Oct 20, 2022 2:54 am

spire.presentation for java 怎么修改ppt文本框的行间距

DemosHume
 
Posts: 35
Joined: Mon Jan 17, 2022 10:22 am

Thu Oct 20, 2022 10:09 am

您好,

感谢您的留言,请参考下面的代码实现您的需求。
如果您有任何问题,欢迎随时联系。

Code: Select all
//加载ppt文档
Presentation presentation = new Presentation();
presentation.loadFromFile("data/test.pptx");

//获取第一形状的所有段落
IAutoShape shape = (IAutoShape) presentation.getSlides().get(0).getShapes().get(0);
ParagraphCollection paraCollection = shape.getTextFrame().getParagraphs();

//为第一个段落设置行距为250
ParagraphEx para = paraCollection.get(0);
para.setLineSpacing(250f);

//保存文档
presentation.saveToFile("output/result.pptx", FileFormat.PPTX_2013);


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 976
Joined: Tue Mar 08, 2022 2:02 am

Mon Oct 31, 2022 6:58 am

您好,

请问我提供的代码满足您的需求了吗?期待在您空闲的时间能给出反馈。希望你有愉快的一天。

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 976
Joined: Tue Mar 08, 2022 2:02 am

Thu Nov 10, 2022 9:16 am

用这种方法能实现我的需求。
我的问题被解决了。
祝好。

DemosHume
 
Posts: 35
Joined: Mon Jan 17, 2022 10:22 am

Thu Nov 10, 2022 9:28 am

您好,

感谢您的反馈。 :)

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 976
Joined: Tue Mar 08, 2022 2:02 am

Return to 中文技术支持