I have purchased a license and am currently using it.
The version used is maven 5.4.2
When 3 word files are merged, the font size 10 text in the first file is converted to font size 11 and saved. There is no code related to font modification, but I want to know why.
The order of file merging is file 1 -> 2 -> 3
code is java
- Code: Select all
/**
* 5.N개 문서들 하나로 병합
*/
Document doc = listDocument.get(0);
for(int i = 1 ; i < listDocument.size() ; i ++) {
doc.getLastSection().setBreakCode(SectionBreakType.New_Page);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
listDocument.get(i).saveToStream(baos, FileFormat.Docx);
InputStream is = new ByteArrayInputStream(baos.toByteArray());
doc.insertTextFromStream(is, FileFormat.Docx);
// doc.importContent(listDocument.get(i), false);
}
doc.getLastSection().setBreakCode(SectionBreakType.New_Page);
/**
* 6.변환된 문서파일(docx , pdf) 임시폴더에 저장
*/
String fileName = StringUtils.stripFilenameExtension(reqMultiBuild.getSaveFileName())+"_"+new Date().getTime();
String filePath = path+File.separator+user.getPathTmpFile()+File.separator+fileName;
log.info("save temp dir path :: {} ", filePath);
//템프폴더 없으면 만들도록 추가
Path fileDir = Paths.get(path+File.separator+user.getPathTmpFile());
if(!Files.exists(fileDir)) {
File dir = new File(fileDir.toString());
dir.mkdirs();
}
doc.isUpdateFields(true);
doc.saveToFile(filePath+".docx", FileFormat.Docx); //docx 파일 저장