请问如何在形状中插入文字



最终想要实现的效果为“

大佬们 求帮助1111111111111111111

@lzx9527 您应该使用如下代码将文本添加到形状:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
        
Shape shape = builder.insertShape(ShapeType.DIAGONAL_CORNERS_SNIPPED,450, 38);
// Create paragraph and add content.
Paragraph para = new Paragraph(doc);
para.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);
para.appendChild(new Run(doc, "Some text"));
// Put paragraph into the shape
shape.appendChild(para);
        
doc.save("C:\\Temp\\out.docx");

out.docx (8.4 KB)

谢谢大佬,大佬可以帮我看下我主页的动态表格的创建吗?我可以有偿谢谢您,太感谢您了

@lzx9527, 我已在您原来的论坛帖子中回复您:https://forum.aspose.com/t/topic/274559/4