استبدال النص في الفن الذكي

سيناريوهات الاستخدام الممكنة

الفن الذكي هو أحد الأشياء الرئيسية في المصنف. في كثير من الأحيان هناك حاجة لتحديث النص في الفن الذكي. Aspose.Cells توفير هذه الميزة عن طريق الضبطالشكل والنص خاصية.

يمكن تنزيل نموذج الملف المصدر من الرابط التالي:

SmartArt.xlsx

عينة من الرموز

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
Workbook wb = new Workbook(srcDir + "SmartArt.xlsx");
for (Object obj : wb.getWorksheets())
{
Worksheet worksheet = (Worksheet)obj;
for (Object shp : worksheet.getShapes())
{
Shape shape = (Shape)shp;
shape.setAlternativeText("ReplacedAlternativeText"); // This works fine just as the normal Shape objects do.
if (shape.isSmartArt())
{
for (Shape smartart : shape.getResultOfSmartArt().getGroupedShapes())
{
smartart.setText("ReplacedText"); // This doesn't update the text in Workbook which I save to the another file.
}
}
}
}
com.aspose.cells.OoxmlSaveOptions options = new com.aspose.cells.OoxmlSaveOptions();
options.setUpdateSmartArt(true);
wb.save(outDir + "outputSmartArt.xlsx", options);