We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

aspose-words使用document.updatefields抛出NullPointerException

我使用的aspose-words版本:com.aspose:aspose-words:20.8:jdk17

异常明细:
Caused by: java.lang.NullPointerException: null
at com.aspose.words.zzZB8.zzX(Unknown Source)
at com.aspose.words.zzZ30.zz5(Unknown Source)
at com.aspose.words.zzZ30.zzX(Unknown Source)
at com.aspose.words.zzZJV.zzZ(Unknown Source)
at com.aspose.words.zzZ30.zzZO(Unknown Source)
at com.aspose.words.zzZ30.zzX(Unknown Source)
at com.aspose.words.zzYSR.zzY(Unknown Source)
at com.aspose.words.zzYSR.zzZ(Unknown Source)
at com.aspose.words.zzYSR.zzZs(Unknown Source)
at com.aspose.words.zzYSR.zz7(Unknown Source)
at com.aspose.words.zzYRZ.zzZCW(Unknown Source)
at com.aspose.words.zz85.zzZCW(Unknown Source)
at com.aspose.words.zzYT2.zzZ(Unknown Source)
at com.aspose.words.zzYT1.zzY(Unknown Source)
at com.aspose.words.zzZZL.zzP(Unknown Source)
at com.aspose.words.zzZZL.zzS(Unknown Source)
at com.aspose.words.zzZZL.zzX(Unknown Source)
at com.aspose.words.zzZZL.zzXU(Unknown Source)
at com.aspose.words.zzZZL.zzZ(Unknown Source)
at com.aspose.words.zzZZL.zzYX(Unknown Source)
at com.aspose.words.Range.updateFields(Unknown Source)
at com.aspose.words.Document.updateFields(Unknown Source)

@Rock_Zhang

能否请您将输入的 Word 文档压缩并附在此处进行测试?

感谢回答,文档是内部用途,不适合附在此处,不过,问题解决了,是在修改文档后调用updatePageLayout后再调用updateFields就会出现该报错,我已想办法忽略该错误。

@Rock_Zhang

很高兴听到您的问题已得到解决。 如果您对 Aspose.Words 有任何疑问,请随时提问,我们将竭诚为您服务。

我们已将此论坛主题设为私密。 现在,只有您和 Aspose 工作人员可以访问此论坛。 如果您想共享您的文档以进行调查,您可以共享它。