# Jacob Document Merge Api **Repository Path**: dingbisheng/jacob-document-merge-api ## Basic Information - **Project Name**: Jacob Document Merge Api - **Description**: 使用jacob合并、转换word文档(doc/docx) - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-16 - **Last Updated**: 2021-07-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # JacobApi ### Description A document merging tool based on Jacob. ### Preface If you want to run the project normally, you must put the file in the corresponding directory. The correspondence between files and paths is as follows. | File | Path | | ------------------ | --------------------- | | jacob.jar | {YourProjectPath}/WEB-INF/lib | |jacob.jar|%JAVA_HOME%/jre/lib/ext| | jacob-1.20-x64.dll & jacob-1.20-x86.dll | %windir%/system32 | | jacob-1.20-x64.dll & jacob-1.20-x86.dll | %JAVA_HOME%/jre/bin | |jacob-1.20-x64.dll & jacob-1.20-x86.dll|{YourProjectPath}/src| ### Guides 1. Editing `application.properties` to change the port and context path. ``` server.port=9797 server.servlet.context-path=/ ``` 2. Run `JacobApiApplication.main()` to start the application 3. Use POST request to access URL `http://localhost:9797/word/merge` #### Merging Files To merge all files and save to the specified location, you need to send a POST request to `/word/merge`. An example of the request body is as follows: ```json { "files":[ "D:\\1.docx", "D:\\2.docx", "D:\\3.docx", "D:\\4.docx", "D:\\5.docx", "D:\\6.docx" ] } ``` #### Converting to HTML To convert word file to html file, you need to send a POST request to `/word/toHtml`. An example of the request body is as follows: ```json { "srcPath":"D:\\src.docx", "destPath":"D:\\dest.txt" } ``` #### Converting to XML To convert word file to xml file, you need to send a POST request to `/word/toXml`. The example is the same as in the previous section. #### Converting to DOCX To convert xml file to docx file, you need to send a POST request to `/xml/toDocx`. The example is the same as in the `Converting to HTML` section.