How to change the font size and style of a paragraph in docx file. Actually i am just taking docx file as a input and want to change the font size, fontstyle of a paragraph?
Thanks in advance....
It is currently Sat Jun 28, 2025 4:20 am
<img height="11" width="11" src="images/example.png"/>
<img height="11px" width="11px" src="images/example.png"/>
img {
width:11px;
height:11px;
}
<body>
<titre>MainTitre</titre>
<texte niv="1" type="DMPART" id="1">
<titre>titleniv1</titre>
<p>myparagraphe</p>
<p>otherPara</p>
<liste type="PUCE">
<item>firtsItem</item>
<item>seconditem</item>
<item>thirdItem</item>
</liste>
<p>paraAgain</p>
</texte>
<texte niv="1" type="DMPART" id="2">
<titre>titleniv1</titre>
<texte niv="2" type="puce" style="noir">
<titre>titleNiv2</titre>
<p>para </p>
</texte>
<texte niv="2" type="puce" style="noir">
<titre>titleniv2</titre>
<p>para</p>
<p>paraAgain </p>
<p>para</p>
</texte>
</texte>
</body>
SpreadsheetMLPackage xlsxPkg = SpreadsheetMLPackage.load(new java.io.File(inputfilepath));
WorkbookPart workbookPart= xlsxPkg.getWorkbookPart();
workbookPart.getContents().getSheets().getSheet().forEach((Sheet sheet)->{
System.out.println(sheet.getName()+" "+sheet.getId());
});
package myartifact;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.apache.log4j.BasicConfigurator;
public class HelloMavenCentral {
public static void main(String[] args) throws Exception {
BasicConfigurator.configure();
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
String filename = "C:\\Users\\Mike\\Desktop\\My.docx";
wordMLPackage.load(new java.io.File(filename) );
}
}
Total posts 10181 • Total topics 2864 • Total members 2095