Error in CTPageSZ class using Apache POI Java NetBeans Word Document

前端 未结 2 967
悲&欢浪女
悲&欢浪女 2021-01-21 06:09

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

相关标签:
2条回答
  • 2021-01-21 06:37

    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 :)

    0 讨论(0)
  • 2021-01-21 06:44

    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

    0 讨论(0)
提交回复
热议问题