I am using mailmerge using xml, but if the table contents are long, the page does not change and continues from one page. I want to know how to solve it.
I will leave the file before and after the change. thank you
This is the code for adding the xml file.
- Code: Select all
String tmpFilePath = path+File.separator+new Date().getTime()+"_tmp.xml";
log.info("tmp File path ::: {}", tmpFilePath);
DOMSource source = new DOMSource(xmlDoc);
File tmpFile = new File(tmpFilePath);
StreamResult result = new StreamResult(new FileOutputStream(tmpFile));
transformer.transform(source, result);
if(tmpFile.exists()){ //tmp 파일 확인후 제거함
try {
//xml파일로 mailMerge 데이터 처리
doc.getMailMerge().executeWidthRegion(tmpFilePath);
if(tmpFile.delete()) log.info("tmp File delete success ::: {}",tmpFilePath);
} catch (IOException e) {
e.printStackTrace();
}
}