@HenryE
Hi, thank you for reporting
I checked your case, it seems that in this case you prepare the document to be signed and for such cases it is locked in order to not be changed before being signed with actual signature - I would suppose it works in such case as empty signature that still prevents document from being changed, therefore you get a message from Adobe
I looked up a bit, seems it should work in pair with PdfFileSignature like following:
static void signature_issue()
{
var pdfdoc = new Aspose.Pdf.Document();
var page = pdfdoc.Pages.Add();
page.Paragraphs.Add(new Aspose.Pdf.Text.TextFragment("Hello Henry!"));
var fe = new FormEditor(pdfdoc);
fe.AddField(FieldType.Signature, "SigField", "My Signature", 1, 100, 700, 400, 750);
pdfdoc.Save(OutputFolder + "myfile.pdf");
using (var pdfSign = new PdfFileSignature())
{
pdfSign.BindPdf(OutputFolder + "myfile.pdf");
var signature = new PKCS1(InputFolder + "signature.pfx", "test");
pdfSign.Sign("SigField", "Reason", "Contact", "Location", signature);
pdfSign.Save(OutputFolder + "myfile_signed.pdf");
}
}
@HenryE
update - I asked development team directly for explanation and I was told that it’s not recommended to add signature field through FormEditor at all and instead use the examples from documentation
So in this case it seems it would be more appropriate:
static void signature_issue()
{
var pdfdoc = new Aspose.Pdf.Document();
var page = pdfdoc.Pages.Add();
page.Paragraphs.Add(new Aspose.Pdf.Text.TextFragment("Hello Henry!"));
var fe = new FormEditor(pdfdoc);
pdfdoc.Save(OutputFolder + "myfile.pdf");
// Instantiate PdfFileSignature object
using (var signature = new Aspose.Pdf.Facades.PdfFileSignature(OutputFolder + "myfile.pdf"))
{
// Create PKCS#7 object for sign
var pkcs = new Aspose.Pdf.Forms.PKCS7(InputFolder + "signature.pfx", "test");
// Sign PDF file
signature.Sign(1, true, new System.Drawing.Rectangle(300, 100, 400, 200), pkcs);
// Save PDF document
signature.Save(OutputFolder + "myfile_signed.pdf");
}
}
Thanks for the information. But it doesn’t quite address my problem. I don’t want to sign the document. I’m only preparing it by adding the necessary fields. The actual signing will take place later in Adobe Sign and will be done there by the users.
@HenryE
Okay, I tried to investigate a bit further and it doesn’t seem to exist another way to add such fields
I think I’ll add task for development team to investigate this issue further
Just to clarify, does this issue prevents document from signing in Adobe Sign or the only problem is that document count as signed although there wasn’t any real signature used?
@HenryE
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-61863
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi Ilya, sorry for the delayed response. The client tested the Adobe Sign process, and it works. So, as you described, Acrobat recognizes the document as signed even though no signature has actually been applied. I suspected that my old code (which I’m currently adapting to the new Aspose.pdf version) was no longer correct.
Thank you for your support.
However, there’s no urgency.