admin管理员组文章数量:1346198
So i will be creating set of 10 slides for each scenarios, and say i may have around 30 scenarios. So i was trying to make this concurrent where the generation of data and creating slide should be made concurrently.
futures.add(executorService.submit(() -> {
try {
List<PowerPointSlideSpec> pptSlides = generalPptGenerator.processSiteResults();
XMLSlideShow threadTemplate = prepareTemplate(TemplateType.BASIC);
SlideResolver slideResolver = new SlideResolver(threadTemplate);
pptSlides.forEach(slideResolver::resolve);
return threadTemplate; // Return thread-local XMLSlideShow
} catch (Exception e) {
log.error("Error processing site result " + siteResult.getName(), e);
throw new RuntimeException("Error processing site result: " + siteResult.getName(), e);
}
After combining the future lists of XMLSlideShow from executorService and forming a single list of XMLSlideShow called threadReports i tried the below code to combine the slides.
XMLSlideShow finalReport = prepareTemplate(TemplateType.BASIC);
for (XMLSlideShow threadReport : threadReports) {
for (XSLFSlide slide : threadReport.getSlides()) {
if (finalReport != null) {
finalReport.createSlide().importContent(slide);
}
}
}
But then this is not a efficient way to combine the slides together. i have to again copy each slide to a new final XMLSlideShow which takes even more time than expected. Any better way of doing this, does apache-poi allow combining multiple slides created separately?
本文标签:
版权声明:本文标题:java - Can we have PPT slide creation with multuthreading using apache-poi which can return single final PPT - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743821585a2544884.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论