Error when using pdfEditor.append: cannot be cast to com.aspose.pdf.kit.nq

We have a process that successfully takes two pdf files and combines them using the pdfEditor.append. In an isolated scenario, we receive the following error message when combining two pdf files:

" cannot be cast to com.aspose.pdf.kit.nq"

What could be causing this?

Thanks for your help!

Hello Daniel,

Thanks for your inquiry.

Would you please share some more details about scenario (i.e Sample Document(s), API Version, JDK Version, etc.), so that we can test it in our environment and respond you accordingly. However by looking at the exception, I think you are using a quite old version of the API which is PDF Kit for Java and has been discontinued.

Please try with latest version of API which is Aspose.Pdf for Java 17.4, as we always recommend to use latest version and in case if you still face any issue, please let us know by sharing above mentioned details.

PS: In order to merge the documents, please refer to “Concatenate PDF Files” article in API documentation.