如何用Java做word里头的艺术字

wordJava

1个回答

写回答

hali618

2026-02-17 21:37

+ 关注

Java
Java

你可以用 Spire.Doc for JavaJava 程序里给 word 文档加艺术字,还能改样式加特效。代码大概是这样的:import com.spire.doc.*;import com.spire.doc.documents.*;import com.spire.doc.fields.ShapeObject;import Java.awt.*;public class wordArt {public static void mAIn(String args) throws Exception {Document doc = new Document();Section section = doc.addSection();Paragraph paragraph = section.addParagraph();ShapeObject shape = paragraph.appendShape(250, 70, ShapeType.Text_Wave_4);shape.setVerticalPosition(80);shape.setHorizontalPosition(100);shape.getwordArt().setText(艺术字效果);shape.setFillColor(Color.RED);shape.setStrokeColor(Color.GRAY);doc.saveToFile(output/wordart.docx, FileFormat.Docx_2013);}}

举报有用(0分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号