Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Can't signing a signature field
  FAQ FAQ  Forum Search   Register Register  Login Login

Can't signing a signature field

 Post Reply Post Reply
Author
Message
Adia View Drop Down
Beginner
Beginner


Joined: 16 Feb 21
Location: Israel
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Adia Quote  Post ReplyReply Direct Link To This Post Topic: Can't signing a signature field
    Posted: 16 Feb 21 at 9:20AM
Hi
I am trying to sign document using PFX file.
in the document I already have a signature filed name "Sig" -  code snip:

int signProcessID = debenu.NewSignProcessFromFile(fileName, "");
int res = debenu.SelectPage(1);          
res = debenu.SetSignProcessField(signProcessID, "Sig");          
res = debenu.SetSignProcessFieldImageFromFile(signProcessID,  Path.Combine(Directory.GetCurrentDirectory(), $"SigImage.jpg"), 0);
res = debenu.SetNeedAppearances(0);
res = debenu.SetSignProcessSubFilter(signProcessID, 3);         
res = debenu.SetSignProcessInfo(signProcessID, "To test digital signatures", "The World", "Contact me");
res = debenu.SetSignProcessPFXFromFile(signProcessID, GetPFXFileName(), "123456");
res = debenu.EndSignProcessToFile(signProcessID, Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid().ToString().Substring(0, 5)}.pdf"));
res = debenu.GetSignProcessResult(signProcessID);
res = debenu.ReleaseSignProcess(signProcessID);

I  getting code 13 from GetSignProcessResult 

Please Advice 




 
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 21 at 10:27AM
First, I suggest not discarding all the res values; check each one.  And also I would recommend moving your SetNeedAppearances to precede the NewSignProcess call.
Back to Top
Adia View Drop Down
Beginner
Beginner


Joined: 16 Feb 21
Location: Israel
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Adia Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 21 at 10:42AM
Thanks for your replay.

I Am checking the res value in debug.
SetNeedAppearances, SetSignProcessFieldall, SetSignProcessFieldImageFromFile,SetSignProcessSubFilter, SetSignProcessInfo,SetSignProcessPFXFromFile return 1.
EndSignProcessToFile return 0.
GetSignProcessResult return 13.

I moved the SetNeedAppearances precede to the NewSignProcessFromFile call
but I getting the same result - 13.





Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3296
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 21 at 10:27PM
Regarding SetNeedApp... you can read this in the documentation:
"...
Most PDF viewers will create the appearance stream for all form fields when the document is opened
..."
This isn't correct behavior if you want to sign a document.
It should be firmed and unchanged.
So try SetNeeApp... with 0 or -1 and it should work as expected.

Cheers and welcome here,
Ingo



Edited by Ingo - 16 Feb 21 at 10:28PM
Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store