Furthermore, in order to create a valid ZUGFerd PDF file with XML invoice attachment, you need to attach a compatible XML invoice that should follow a specific format. We tested the file shared by you and found that it was not a compatible document. 2020-12-03_00-10-20.png (37.2 KB)
Please also check below-attached files which are a valid ZUGFerd PDF and a compatible XML invoice.
any update on JDK 1.6 version of ASPOSE??
I thought I can creat it as java object in oracle db but oracle JVM is 1.7 ,unfortunately [Aspose.PDF for Java 20.11] jar is not working.
Aspose.PDF for Java is also released for JDK 1.7 separately. Please download it from the link given below and let us know if issue occurs with JDK 1.7 as well.
We would like to share with you that related ticket PDFJAVA-39966 has been resolved and its fix will be included in Aspose.PDF for Java 20.12. You will surely receive a notification as soon as the release is available.
We regret that we cannot fix this issue in the version which has already been out for download. We have included the fix of the error in upcoming release which is yet to be published.
Thanks for your feedback. We will further review it and let you know about the updates in this regard.
Thank you for the update.Is Aspose PDF for JAVA 20.12 supports digital signature and verification too?? If so could you send me sample code for the same
I am able to get the sample code from Github but I am getting below error message while I am compiling . I am using aspose-pdf-20.12-jdk16.jar . Pl advise
certify(int,java.lang.String,java.lang.String,java.lang.String,boolean,java.awt.Rectangle,com.aspose.pdf.DocMDPSignature) in com.aspose.pdf.facades.PdfFileSignature cannot be applied to (int,java.lang.String,java.lang.String,java.lang.String,boolean,com.aspose.pdf.Rectangle,com.aspose.pdf.DocMDPSignature)
pdfFile.certify(1, “Signature Reason”, “Contact”, “Location”, true, rect,docMdpSignature );
public class AsposeTestDigSign {
private String dataDir = “/u01/oracle/devc/comn/java/oracle/apps/xxdomi/aspose/files/”;
private String concDir = “/u01/oracle/devc/comn/admin/out/DEVC_dps-ap-erpdev2/”;
public AsposeTestDigSign(){
}
public static void main(String[] args) throws Exception {
for (String s: args){
new AsposeTest().Run(s);
}
}
public void Run(String f) throws Exception{
License lic = new License();
lic.setLicense(dataDir + "Aspose.PDF.Java.lic");
attachDigSign(f);
System.out.println("Done16..");
}
public void attachDigSign(String f) {
// Document doc = new Document(concDir+f);
com.aspose.pdf.facades.PdfFileSignature pdfFile = new com.aspose.pdf.facades.PdfFileSignature();
pdfFile.bindpdf(concDir+f);
PKCS7 pkcs = new PKCS7(dataDir+"ThomasMiller.pfx", "1234567890");
DocMDPSignature docMdpSignature = new DocMDPSignature(pkcs, DocMDPAccessPermissions.FillingInForms);
Rectangle rect = new Rectangle(100, 600, 400, 100);
// Set signature appearance
pdfFile.setSignatureAppearance("aspose-logo.png");
// Create any of the three signature types
pdfFile.certify(1, "Signature Reason", "Contact", "Location", true, rect,docMdpSignature );
// Save digitally signed PDF file
pdfFile.save(dataDir+"Digitally Signed PDF.pdf");
}
Could you please share your sample PDF document and .pfx file with us so that we can also test the scenario in our environment and address it accordingly.
You have been noticing the issue because of not using correct Rectangle Class. Please check following code snippet which we used for the testing with Aspose.PDF for Java 21.1:
com.aspose.pdf.facades.PdfFileSignature pdfFile = new com.aspose.pdf.facades.PdfFileSignature();
pdfFile.bindPdf(dataDir + "35064981.pdf");
PKCS7 pkcs = new PKCS7(dataDir + "ThomasMiller.pfx", "1234567890");
DocMDPSignature docMdpSignature = new DocMDPSignature(pkcs, DocMDPAccessPermissions.FillingInForms);
java.awt.Rectangle rect = new java.awt.Rectangle(100, 600, 400, 100);
// Set signature appearance
pdfFile.setSignatureAppearance(dataDir + "aspose.png");
// Create any of the three signature types
pdfFile.certify(1, "Signature Reason", "Contact", "Location", true, rect, docMdpSignature);
// Save digitally signed PDF file
pdfFile.save(dataDir + "Digitally Signed PDF.pdf");
However, we faced another exception i.e.
class com.aspose.pdf.internal.ms.System.Security.Cryptography.l0y: Invalid MAC - file may have been tampered! ---> class com.aspose.pdf.internal.l63f.lk: Invalid MAC - file may have been tampered!
Therefore, we have logged an issue as PDFJAVA-40117 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.
We are trying to create digital Signature through your code in the PDF document but while compiling your code we are facing below error.
Please check and suggest on this Error.
For you reference i have attached sample code pack as well.
--------------------------------------Error Message-------------------------------------------------------
dps-ap-erpdev2.dps.local:DEVC:appldevc>javac AsposeTest1.java
AsposeTest1.java:47: cannot find symbol
symbol : method certify(int,java.lang.String,java.lang.String,java.lang.String,boolean,com.aspose.pdf.Rectangle,com.aspose.pdf.DocMDPSignature)
location: class com.aspose.pdf.DocMDPSignature
DocMDPSignature.certify(1, “SignatureReason”, “Contact”, “location”, true, rect, docMdpSignature);
^
1 error
dps-ap-erpdev2.dps.local:DEVC:appldevc>javac AsposeTest1.java
AsposeTest1.java:47: certify(int,java.lang.String,java.lang.String,java.lang.String,boolean,java.awt.Rectangle,com.aspose.pdf.DocMDPSignature) in com.aspose.pdf.facades.PdfFileSignature cannot be applied to (int,java.lang.String,java.lang.String,java.lang.String,boolean,com.aspose.pdf.Rectangle,com.aspose.pdf.DocMDPSignature)
signature.certify(1, “SignatureReason”, “Contact”, “location”, true, rect, docMdpSignature);
^
1 error
dps-ap-erpdev2.dps.local:DEVC:appldevc>
We could not find any attached source in your post. Please make sure to attach sample PDF and code snippet for our reference so that we can test the scenario in our environment and address it accordingly.