admin 管理员组文章数量: 887021
org.docx4j/docx4j/ Maven依赖写法
Maven下载jar包
org.docx4j
docx4j
3.1.0
实例代码:
package com.tourMarket.tools;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileChannel.MapMode;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apachemons.io.IOUtils;
import org.docx4j.dml.wordprocessingDrawing.Inline;
import org.docx4j.jaxb.Context;
import org.docx4j.openpackaging.exceptions.Docx4JException;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.PartName;
import org.docx4j.openpackaging.parts.WordprocessingML.AlternativeFormatInputPart;
import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage;
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
import org.docx4j.relationships.Relationship;
import org.docx4j.wml.Br;
import org.docx4j.wml.CTAltChunk;
import org.docx4j.wml.Drawing;
import org.docx4j.wml.ObjectFactory;
import org.docx4j.wml.P;
import org.docx4j.wml.R;
import org.docx4j.wml.STBrType;
import com.alibaba.fastjson.JSONObject;
public class DocUtil {
private static ObjectFactory factory = new ObjectFactory();
/**
* 合并docx
* @param streams
* @return
* @throws Docx4JException
* @throws IOException
*/
/**
* 合并docx
* @param streams 要合并的word文件的输入流
* @param path 合并后的文件的路径
* @return
* @throws Docx4JException
* @throws IOException
*/
public static File mergeDocx(final List streams, String path) throws Docx4JException, IOException {
Word
版权声明:本文标题:java合并word_java实现合并多个word文档 且可换页 实例代码(基于docx4j) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1726310038h934240.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论