Digital Signature
Digital Signature
Hi,
I have the latest version of PDF Converter Developer Pro 3.0. I want to add a digital signature into my pdf files with Visual Fox Pro 9.0
I get examples for your forum, but it doesn’t works okey.
I've installed the printer with this command:
run /n1 install.exe -s "Amyuni PDF Converter" -n "UserName" -c "license code"
I've registered the all libraries of pdf
First example:
pdfdoc=CREATEOBJECT("CDIntfEx.Document")
pdfdoc.SetLicenseKey("Licencia","Activate Code")
lOpen=pdfdoc.open("c:\prueba.pdf")
if lOpen
lAdd=pdfdoc.DigitalSignature ("Entidad","razon firma", "c:\firma.bmp", "Barcelona", -1, 0, 0, 3000, 3000,8)
if lAdd
pdfdoc.Save ("c:\prueba_sign.pdf")
endif
endif
** lAdd variable is False. DigitalSignature return false
Second Example:
CreatorRef = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
CreatorRef.SetLicenseKey (Licensee, ActivationCode)
CreatorRef.Open (GETFILE("pdf"), "")
CreatorRef.DigitalSignature ("Fernando Puyuelo Ossorio", "Signature", "", "MAdrid", "1", 500, 400, 300, 300, 1+2+4+8+64)
CreatorRef.Save ("SignedDocument.pdf", 0)
The DigitalSignature function returns “Denied Access” message error
Can you tell me some solution?
I have the latest version of PDF Converter Developer Pro 3.0. I want to add a digital signature into my pdf files with Visual Fox Pro 9.0
I get examples for your forum, but it doesn’t works okey.
I've installed the printer with this command:
run /n1 install.exe -s "Amyuni PDF Converter" -n "UserName" -c "license code"
I've registered the all libraries of pdf
First example:
pdfdoc=CREATEOBJECT("CDIntfEx.Document")
pdfdoc.SetLicenseKey("Licencia","Activate Code")
lOpen=pdfdoc.open("c:\prueba.pdf")
if lOpen
lAdd=pdfdoc.DigitalSignature ("Entidad","razon firma", "c:\firma.bmp", "Barcelona", -1, 0, 0, 3000, 3000,8)
if lAdd
pdfdoc.Save ("c:\prueba_sign.pdf")
endif
endif
** lAdd variable is False. DigitalSignature return false
Second Example:
CreatorRef = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
CreatorRef.SetLicenseKey (Licensee, ActivationCode)
CreatorRef.Open (GETFILE("pdf"), "")
CreatorRef.DigitalSignature ("Fernando Puyuelo Ossorio", "Signature", "", "MAdrid", "1", 500, 400, 300, 300, 1+2+4+8+64)
CreatorRef.Save ("SignedDocument.pdf", 0)
The DigitalSignature function returns “Denied Access” message error
Can you tell me some solution?
Re: Digital Signature
Hello,
Here is a sample code on calling the DigitalSignature function
pdfdoc.DigitalSignature "Signature2048bits", "My reason for signing the document", "C:\Temp\signature.jpg", "USA", 1, 1000, 1000, 2000, 2000, 1 + 2 + 4 + 8 + 32 + 64
Your second sample is right but you need to make sure that there is a signature on the PC called "Fernando Puyuelo Ossorio". Also the '1' shouldn't be in quotation, it is an integer and not a string.
Please make sure that you have the professional version of the PDF Converter. The Digital Signature feature is only in the professional version.
Hope this helps.
Here is a sample code on calling the DigitalSignature function
pdfdoc.DigitalSignature "Signature2048bits", "My reason for signing the document", "C:\Temp\signature.jpg", "USA", 1, 1000, 1000, 2000, 2000, 1 + 2 + 4 + 8 + 32 + 64
Your second sample is right but you need to make sure that there is a signature on the PC called "Fernando Puyuelo Ossorio". Also the '1' shouldn't be in quotation, it is an integer and not a string.
Please make sure that you have the professional version of the PDF Converter. The Digital Signature feature is only in the professional version.
Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Re: Digital Signature
Hi Joan and everybody
My function to sing my pdf's works okey now, but sometimes when execute the next sentence ((( pdfdoc.Save ("c:\prueba_sign.pdf") )))
OLE exception error: Exception code c0000005. OLE object may be corrupt
Do you know because this error message is produced?
I try to uninstall my pdf converter and install again, but sometimes give me this message
Thank You
Have a nice day!!
Best regards
Sergio
My function to sing my pdf's works okey now, but sometimes when execute the next sentence ((( pdfdoc.Save ("c:\prueba_sign.pdf") )))
OLE exception error: Exception code c0000005. OLE object may be corrupt
Do you know because this error message is produced?
I try to uninstall my pdf converter and install again, but sometimes give me this message
Thank You
Have a nice day!!
Best regards
Sergio
Re: Digital Signature
In cdintf300.h there is no definition for function DigitalSignature, can you please provide one or tell me where I can download an updated include file ?
TIA
TIA
Davide Zaccanti
Re: Digital Signature
We have a tool on our web site that validates the certificate being used and gives a better indication of why DigitalSignature might be failing. You can download the tool from:
http://www.amyuni.com/downloads/digisign_test.zip
The crash when saving might be related to the specific PDF file being used. You would need to open a support ticket in order for us to investigate that.
http://www.amyuni.com/en/support/perincident.html
Using DigitalSignatures from a DLL interface is not very straightforward (question by Zaksoft), you need to use the following DLL functions:
// set the permanent license key for the product
BOOL WINAPI SetLicenseKeyA(LPCSTR szCompany, LPCSTR szLicKey);
// Open the document, handle returned in pedhDocument
int WINAPI DocOpenA(EXTDOCHANDLE* pedhDocument, LPCSTR szFileName, LPCSTR szPassword);
// Sign the document
int WINAPI DocDigitalSignatureA(EXTDOCHANDLE edhDocument, LPCSTR SignedBy, LPCSTR Reason, LPCSTR ImageFile, LPCSTR Location, long PageNumber, long HorzPos, long VertPos, long Width, long Height, long Flags);
// Save the document
int WINAPI DocSaveA(EXTDOCHANDLE edhDocument, LPCSTR szFileName);
// Close the document
int WINAPI DocClose(EXTDOCHANDLE edhDocument);
http://www.amyuni.com/downloads/digisign_test.zip
The crash when saving might be related to the specific PDF file being used. You would need to open a support ticket in order for us to investigate that.
http://www.amyuni.com/en/support/perincident.html
Using DigitalSignatures from a DLL interface is not very straightforward (question by Zaksoft), you need to use the following DLL functions:
// set the permanent license key for the product
BOOL WINAPI SetLicenseKeyA(LPCSTR szCompany, LPCSTR szLicKey);
// Open the document, handle returned in pedhDocument
int WINAPI DocOpenA(EXTDOCHANDLE* pedhDocument, LPCSTR szFileName, LPCSTR szPassword);
// Sign the document
int WINAPI DocDigitalSignatureA(EXTDOCHANDLE edhDocument, LPCSTR SignedBy, LPCSTR Reason, LPCSTR ImageFile, LPCSTR Location, long PageNumber, long HorzPos, long VertPos, long Width, long Height, long Flags);
// Save the document
int WINAPI DocSaveA(EXTDOCHANDLE edhDocument, LPCSTR szFileName);
// Close the document
int WINAPI DocClose(EXTDOCHANDLE edhDocument);
Amyuni Development Team
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Re: Digital Signature
I've inserted the declaration as described, all code compile fine, but when linking I've got:
Error 2 error LNK2019: unresolved external symbol "int __stdcall DocDigitalSignatureA(void *,char const *,char const *,char const *,char const *,long,long,long,long,long,long)"
Sure of all parameters ?
Error 2 error LNK2019: unresolved external symbol "int __stdcall DocDigitalSignatureA(void *,char const *,char const *,char const *,char const *,long,long,long,long,long,long)"
Sure of all parameters ?
Davide Zaccanti
Re: Digital Signature
Hello,
Your code is right but you may have an old version of CDIntf or an old .h file.
Please make sure that you have the right .h file for your version of CDIntf and if your version is old you can upgrade it by contacting support@amyuni.com
Hope this helps.
Your code is right but you may have an old version of CDIntf or an old .h file.
Please make sure that you have the right .h file for your version of CDIntf and if your version is old you can upgrade it by contacting support@amyuni.com
Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Re: Digital Signature
I will send an email, but it's the latest one zip file (re-downloaded also yesterday) that pdf manul points to.
TIA
TIA
Davide Zaccanti
Re: Digital Signature
..no answer from support... cona you please investigate if they have received my mail ?
TIA.
TIA.
Davide Zaccanti
Re: Digital Signature
Hello ,
I will check this.
Please let me know which version of the driver you are currently using? Is it 3.0 or 3.02 or 3.02a?
I will check this.
Please let me know which version of the driver you are currently using? Is it 3.0 or 3.02 or 3.02a?
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Re: Digital Signature
The latest available for download (marked 3.02 - PDF Suite).
Can be a good idea to restore on the login page for download updates the header with information about version, it has been present for a while (claiming 3.02 dec 2007) but now is not shown and i have to doenload weekly the package to verify if it is updated..
TIA
Can be a good idea to restore on the login page for download updates the header with information about version, it has been present for a while (claiming 3.02 dec 2007) but now is not shown and i have to doenload weekly the package to verify if it is updated..
TIA
Davide Zaccanti
Re: Digital Signature
Hello,
We are currently updating the log in page. I am sure we are planning to add the date and version number of each release, i will mention this to the concerned person however.
I will check if our technical support received your email. Mainly we need to check if the version you have has the Digital Signature function and if it does you need to make sure that you are using the corresponding .h file.
I will check this and get back to you
We are currently updating the log in page. I am sure we are planning to add the date and version number of each release, i will mention this to the concerned person however.
I will check if our technical support received your email. Mainly we need to check if the version you have has the Digital Signature function and if it does you need to make sure that you are using the corresponding .h file.
I will check this and get back to you
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Re: Digital Signature
Hi. I have 3.02 version.
Now I'll try to send an email to support department.
Thanks
Now I'll try to send an email to support department.
Thanks
Re: Digital Signature
I've received both .h and .lib from support (thank you).
1) .h is dated 2007 and there is no definition of DigitalSignature(...)
2) there are other errors, like definitions ( MergeFiles.. LinearizeDocument.. etc) that have to be moved outside extern C declaration to avoid link errors (I've done the some with any other previous .h) for mangled names
3) With new .LIB the program compiles without errors.. now I've to verify if the call works as expected, it may tooks few days for problems related to my smart card..
Hope this helps also other people..
P.S. I normally add also a #pragma for automatic lib linking in my .h, can be a suggestion for upcoming 3.03 when .h and .lib will be updated
1) .h is dated 2007 and there is no definition of DigitalSignature(...)
2) there are other errors, like definitions ( MergeFiles.. LinearizeDocument.. etc) that have to be moved outside extern C declaration to avoid link errors (I've done the some with any other previous .h) for mangled names
3) With new .LIB the program compiles without errors.. now I've to verify if the call works as expected, it may tooks few days for problems related to my smart card..
Hope this helps also other people..
P.S. I normally add also a #pragma for automatic lib linking in my .h, can be a suggestion for upcoming 3.03 when .h and .lib will be updated
Davide Zaccanti
Re: Digital Signature
Hi Joan,
I have the 3.02 version of pdf converter. And the version of the CDIntf.dll is 3.0.2.0
I continue having the same message error.
When execute the next sentence ((( pdfdoc.Save ("c:\prueba_sign.pdf") )))
OLE exception error: Exception code c0000005. OLE object may be corrupt
What can I do? can you tell me a solution?
Thank you
I have the 3.02 version of pdf converter. And the version of the CDIntf.dll is 3.0.2.0
I continue having the same message error.
When execute the next sentence ((( pdfdoc.Save ("c:\prueba_sign.pdf") )))
OLE exception error: Exception code c0000005. OLE object may be corrupt
What can I do? can you tell me a solution?
Thank you