Hi,
Is there a way to map FoUserAgent with fosettings of docx4j?
Thanks.
It is currently Tue Nov 26, 2024 3:40 am
<base>./</base>
<font metrics-url="servlet-context:/fonts/DejaVuSerif-Bold.xml" embed-url="servlet-context:/WEB-INF/fonts/DejaVuSerif-Bold.ttf" kerning="yes">
<font-triplet name="DejaVuSerif-Bold" style="normal" weight="normal" />
</font>
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(wordMLPackage);
ClassPathResource cpr = new ClassPathResource("fop.conf");
InputStream inputStream = cpr.getInputStream();
StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, "UTF-8");
String conf = writer.toString();
List<Object> paragraphs = getAllElementFromObject(template.getMainDocumentPart(),P.class);
for(Object objP:paragraphs) {
P para = (P) objP;
/***/
List<Object> texts = getAllElementFromObject(para,Text.class);
List<Object> brs = getAllElementFromObject(para,Br.class);
if(brs.size()==1 && checkPageBreak((Br)brs.get(0)) && texts.size()== 0)
remove(template.getMainDocumentPart().getContent(), para);
}
Total posts 10111 • Total topics 2842 • Total members 2074