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

本文标签: 多个 实例 代码 文档 换页