Print Page | Close Window

Problems on adding digital signature

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=3454
Printed Date: 29 Apr 24 at 1:10AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problems on adding digital signature
Posted By: yuen
Subject: Problems on adding digital signature
Date Posted: 19 Apr 17 at 11:54AM
Hi,
I'm trying to add digital signature on some pdfs but my program terminate in DPLSignFileA without warning.
I work with DebenuPDFLibraryLIB0916, MFC on Visual studio 2012.
I have no idea what is wrong.
Please help.

Here is what I did:

CString inputFileName = "C:\\Temp\\test.pdf";
    CString openPassword = "";
    CString signatureFieldName = "Signature1";
    CString outputFileName = "C:\\Temp\\Signed.pdf";
    CString pfxFileName = "C:\\Temp\\aaa.pfx";
    CString pfxPassword = "aaa";
    CString reason = "";
    CString location = "";
    CString contactInfo = "";

    CStringW strLicenseKey(LICENCEKEY_DEBENU_PDFLIB);
    int m_InstanceID = DPLCreateLibrary();
    int iResult = DPLUnlockKey(m_InstanceID, (WCHAR*)(LPCUWSTR)strLicenseKey);

    int ret = DPLSignFileA(m_InstanceID, (char*)(LPCTSTR)inputFileName,
                                        (char*)(LPCTSTR)openPassword,
                                        (char*)(LPCTSTR)signatureFieldName,
                                        (char*)(LPCTSTR)outputFileName,
                                        (char*)(LPCTSTR)pfxFileName,
                                        (char*)(LPCTSTR)pfxPassword,
                                        (char*)(LPCTSTR)reason,
                                        (char*)(LPCTSTR)location,
                                        (char*)(LPCTSTR)contactInfo);





Replies:
Posted By: Ingo
Date Posted: 19 Apr 17 at 6:51PM
Hi Yuen,

what is function LastErrorCode telling you?
You should insert it directly after your problem function call.
If this doesn't give you any idea you should search here:
http://www.debenu.com/docs/pdf_library_reference/Search.php
with the tag "search".

Cheers and welcome here,
Ingo



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



Posted By: yuen
Date Posted: 20 Apr 17 at 1:21PM
Ingo,

Thank you for reply.
Unfortunately, the problem function terminate before returning value,
so I couldn't get the result of GetLastError().
If I set parameter pfxFileName to be empty or wrong paths,
the function ends properly and returns error value.


Posted By: Ingo
Date Posted: 20 Apr 17 at 5:12PM
Hi :)

so some of your pdfs are protected?
How are the security settings?
Is there a master-password (not the user password)?
Try decrypt before signing...



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



Posted By: yuen
Date Posted: 21 Apr 17 at 4:05AM
Hi

I tried to use DLL Edition instead of LIB Edition then it works fine.
So I guess my pdfs are not protected.

The error I got in LIB Edition is 0xC0000005: Access violation.
I guess some of my setting in my IDE are incorrect but other function works well or ...



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