We are migrating the obsolete Aspose.Pdf.Kit library to Aspose.Pdf version 9.0.0 and experience difficulties with signing a document.
The example code in the JavaDoc gives the same compilation error as we experience, so this can be used as a reproduction for the problem:
1 String inFile = TestPath + "example1.pdf"; 2 String outFile = TestPath + "signature.pdf"; 3 PKCS1 sig = new PKCS1("certificate.pfx", "password"); 4 sig.setReason ("Some reason"); 5 sig.setContact ("Smith"); 6 sig.setLocation ("New York"); 7 PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile); 8 Rectangle rect = new Rectangle(100, 100, 200, 100); 9 pdfSign.setSignatureAppearance ( TestPath + "butterfly.jpg"); 10 pdfSign.sign(2, true, rect, sig); 11 pdfSign.save();
Line 3 does not compile and gives the following error:
- com.aspose.pdf.engine.security cannot be resolved to a type - The type com.aspose.pdf.b.d cannot be resolved. It is indirectly referenced from required .class files