gpt4 book ai didi

java.lang.ClassNotFoundException : org. apache.poi.xwpf.usermodel.IRunBody

转载 作者:行者123 更新时间:2023-12-01 11:15:09 26 4
gpt4 key购买 nike

我正在尝试使用 xdocreport 将 docx 转换为 pdf,但最终出现 IRunBody 类的 classnot find 异常。我的包“org.apache.poi.xwpf.usermodel”似乎没有这个接口(interface)。我有为此所需的所有 jar 。 poi、poi-ooxml、poi-ooxml-schemas 但我无法获得此类。谁能让我知道我在这里缺少什么?我还需要添加其他 jar 吗?下面是我正在运行的代码

        XWPFDocument xwpfDoc = new XWPFDocument(new FileInputStream(fileName));
PdfOptions options = PdfOptions.create().fontEncoding("windows-1250");
String randomFilename = UUID.randomUUID().toString();
String outputFIlePath = TEMPORARY_PDF_FILE_LOCATION + randomFilename + ".pdf";
OutputStream output = new FileOutputStream(outputFIlePath);
PdfConverter.getInstance().convert(xwpfDoc, output, options);

最佳答案

我的 ooxml jar 不是最新的。更新ooxml jar后,问题得到解决。谢谢。

关于java.lang.ClassNotFoundException : org. apache.poi.xwpf.usermodel.IRunBody,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31919168/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com