I try to produce a Microsoft Word document by using Apache POI and Java. I was really happy with the result until I try to change the orientation of the document to landscape. I
I was facing a similar issue with CTPageSz! I guess you are using the wrong jar!
Basically there are 2 jars, one is the poi-ooxml-schemas jar and the other being simply the ooxml-schemas jar.
What I've read around the internet is that the poi variant of the jar is smaller and contains only classes that one generally requires. And you get this variant when you download the apache-poi package from their website.
You need to include the other variant in your project i.e the simple ooxml-jar which can be found here. The jar is 14.8MB in size, significantly bigger than the poi variant.
Hope this helps. All the best :)
i had the same issue, i did compile this dependencies, and the problem has been resolve
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.3</version>
</dependency>
try to used it, and tell me if it work to you