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!
![]() |
Can't signing a signature field |
Post Reply
|
| Author | |
Adia
Beginner
Joined: 16 Feb 21 Location: Israel Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Topic: Can't signing a signature fieldPosted: 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 |
|
![]() |
|
tfrost
Senior Member
Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Adia
Beginner
Joined: 16 Feb 21 Location: Israel Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store