Hi,
Is there a way to map FoUserAgent with fosettings of docx4j?
Thanks.
It is currently Sun Apr 27, 2025 1:59 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();
<w:p><w:r><w:t xml:space="preserve">1 Example 3a (bold) 1</w:t></w:r></w:p>
<block font-size="10.5pt" line-height="100%" space-after="0in" space-before="0in" text-align="justify"><inline><inline font-family="Times New Roman">1 Example 3a (bold) 1</inline></inline></block>
<w:p>
<w:r>
<w:pict>
<v:shape type="#_x0000_t75" style="position:absolute;margin-left:0;margin-top:0;width:113.35pt;height:67.61475716064757pt;z-index:-251657216;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin" o:hralign="left" o:allowincell="f" o:insetmode="custom" o:connectortype="straight">
<v:imagedata o:title="watermark" r:id="rId3" gain="19661f" blacklevel="22938f"/>
</v:shape>
</w:pict>
</w:r>
</w:p>
<simple-page-master margin-bottom="0.5in" margin-left="0.5in" margin-right="0.5in" margin-top="0.5in" master-name="s1-simple" page-height="11in" page-width="8.5in">
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 10160 • Total topics 2859 • Total members 2089