用Aspose.word 22.10 for java 比较PDF文件出错

今天下载试用 Aspose.word 22.10 for java, 按照 比较 Java 中的 PDF (aspose.com) 中提供的示例代码执行时出错。

import com.aspose.words.*;

Document docA = new Document(“Input1.pdf”);
Document docB = new Document(“Input2.pdf”);

// 比较前不应该有任何修改。
docA.acceptAllRevisions();
docB.acceptAllRevisions();

docA.compare(docB, “Author Name”, new Date());
docA.save(“Output.pdf”);

错误信息如下:
Pdf format is not supported on this platform. Use .NET Standard or .NET 4.6.1 version of Aspose.Words for loading Pdf documents.
at com.aspose.words.zzZbj.zzYuP(Unknown Source)
at com.aspose.words.Document.zzWWH(Unknown Source)
at com.aspose.words.Document.zzWwL(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)

比较docx 文件是正常的。

@evonli Sorry, for confusion. Currently, Aspose.Words for Java does not support loading PDF documents. This feature request is logged as WORDSJAVA-2366 . This feature is supported only in .NET and Python versions of Aspose.Words.
Aspose.Words for .NET is used as backend of this app.

@alexey.noskov 非常感谢您的回复! 期待新版本。

1 Like