Print Page | Close Window

Can't get DPLSignFile to work

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3458
Printed Date: 28 Mar 24 at 8:18PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Can't get DPLSignFile to work
Posted By: jomski
Subject: Can't get DPLSignFile to work
Date Posted: 12 May 17 at 7:15AM
I'm using Trial Version of QuickPDF v13.12, and I can't seem to get DPLSignFile to work. This is the barest minimum code that I made and I'm still stuck.

I'm using the code below:
Quote
DEBENUPDFLIBRARYLIB1312_DllMain(GetModuleHandle(NULL), DLL_PROCESS_ATTACH, NULL);
int InstanceID = DPLCreateLibrary();
auto retValue = DPLUnlockKey(InstanceID,L"my_unlock_key");

retValue = DPLSignFile(InstanceID, L"C:\\Users\\jmante\\Documents\\Unsigned.pdf",
L"",
L"DIGITAL_SIGNATURE",
L"C:\\Users\\jmante\\Documents\\Signed.PDF",
L"C:\\Users\\jmante\\Documents\\MyOwn.pfx",
L"123456789",
L"To test digital signatures",
L"The World",
L"Contact me");

DPLReleaseLibrary(InstanceID);
DEBENUPDFLIBRARYLIB1312_DllMain(GetModuleHandle(NULL), DLL_PROCESS_DETACH, NULL);
    return 0;
}


DPLSignFile always returns 1 but when I check the file using Acrobat DC it looks exactly as the unsigned version. There is also no Signature Tab/Panel. 

Thanks in advance.



Replies:
Posted By: Ingo
Date Posted: 12 May 17 at 9:45AM
Hi Jomski,

about signing files please first read here:
http://www.debenu.com/kb/advanced-options-signing-pdf-files/
...and in the developer guide.
Both should give help.

Cheers and welcome here,
Ingo


-------------
Cheers,
Ingo



Posted By: jomski
Date Posted: 14 May 17 at 11:42PM
Originally posted by Ingo Ingo wrote:

Hi Jomski,

about signing files please first read here:
http://www.debenu.com/kb/advanced-options-signing-pdf-files/
...and in the developer guide.
Both should give help.

Cheers and welcome here,
Ingo

Thanks Ingo! My next step after this is to add visual digital signature (which is also in the developer guide, very handy!). I will try this and see where this takes me.

Cheers!


Posted By: jomski
Date Posted: 17 May 17 at 2:01AM
I got it to work finally! And the problem is not in the Debenu Library. It's in the PDF I was trying to sign. 

Initially I'm trying to sign a temporary PDF file that was created by MS Word. I'm not sure what flags is MS-Word using but signing ANY PDF generated by MS Word ALWAYS fails. Very very frustrating!

I tried with another PDF file and it signed it perfectly, no problem at all.

Anyways. Thanks Ingo for the help.

Cheers!


Posted By: Ingo
Date Posted: 17 May 17 at 8:51AM
Hi,

after Load you can check the document properties (author/creator).
If it's MS Word you can do a LoadFromFile and a new SaveToFile (and then it's QuickPDF and should work for you ;-)



-------------
Cheers,
Ingo



Posted By: jomski
Date Posted: 17 May 17 at 11:44PM
Originally posted by Ingo Ingo wrote:

Hi,

after Load you can check the document properties (author/creator).
If it's MS Word you can do a LoadFromFile and a new SaveToFile (and then it's QuickPDF and should work for you ;-)


Ahh that's a neat trick. I will definitely keep that in mind! Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk