I have a requirement to apply a p7c (digital ID) signature to a PDF file programatically, through VB6.
Can Amyuni pdfcreator prof help me to do this?
I downloaded the trial version, but cannot find an API documentation. Where can i find documentation about digital singing with amyuni products..?
many thanks,
govie
digital signature newbie questions
Example
Hello Fernando,
Please find here a code to sign a PDF document. This is a VBA code. Please note that this code doesn't include all the general declarations, you need to add the declarations for the different variables yourself.
I guess you already posted your question to the forum. Please feel free to post the below code or the variation that you will be using so other customers having the same question and browsing the forum will check it.
==============================Code starts here ===============================
Public cdi As CDIntfEx.CDIntfEx
Public pdfdoc as CDIntfEx.Document
Private Sub AxDigitalSignature_Click()
'******This code Digitally sign an existing PDF document ******/
' Note: You need to have a Professional version of the PDF Converter
' and a valid signature on your system to be able to sign a PDF document
' Open the pdf file to be exported - This feature is available only in the Professional version of the driver
PdfDoc.Open (MyDirectory + "ActiveXSample.pdf")
' SetLicenseKey is needed with some advanced funtions like DigitalSignature
PdfDoc.SetLicenseKey LicensedTo, ActivationCode
' DigitalSignature: the signature name here is "Test2".
PdfDoc.DigitalSignature "TestSignature", "Testing", MyDirectory + "signature.jpg", "Montreal", 1, 5000, 4000, 2000, 2000, 1 + 2 + 4 + 8 + 32 + 64
'Save the signed document
PdfDoc.Save MyDirectory + "SignedDocument.pdf"
End Sub
============================= Code ends here ==================================
Hope this helps. If you need further information please send a message to either support@amyuni.com or to me directly so your request will not be processed twice.
Best Regards,
Joanna Khoury
Amyuni Technologies
www.amyuni.com
Please find here a code to sign a PDF document. This is a VBA code. Please note that this code doesn't include all the general declarations, you need to add the declarations for the different variables yourself.
I guess you already posted your question to the forum. Please feel free to post the below code or the variation that you will be using so other customers having the same question and browsing the forum will check it.
==============================Code starts here ===============================
Public cdi As CDIntfEx.CDIntfEx
Public pdfdoc as CDIntfEx.Document
Private Sub AxDigitalSignature_Click()
'******This code Digitally sign an existing PDF document ******/
' Note: You need to have a Professional version of the PDF Converter
' and a valid signature on your system to be able to sign a PDF document
' Open the pdf file to be exported - This feature is available only in the Professional version of the driver
PdfDoc.Open (MyDirectory + "ActiveXSample.pdf")
' SetLicenseKey is needed with some advanced funtions like DigitalSignature
PdfDoc.SetLicenseKey LicensedTo, ActivationCode
' DigitalSignature: the signature name here is "Test2".
PdfDoc.DigitalSignature "TestSignature", "Testing", MyDirectory + "signature.jpg", "Montreal", 1, 5000, 4000, 2000, 2000, 1 + 2 + 4 + 8 + 32 + 64
'Save the signed document
PdfDoc.Save MyDirectory + "SignedDocument.pdf"
End Sub
============================= Code ends here ==================================
Hope this helps. If you need further information please send a message to either support@amyuni.com or to me directly so your request will not be processed twice.
Best Regards,
Joanna Khoury
Amyuni Technologies
www.amyuni.com
Hello,
Below is an activex VFP code snippet which illustrates how to implements Digital Signatures.
Hope this helps?
**Create Document Object
PDFdoc = CREATEOBJECT("CDIntfEx.Document")
PDFdoc.SetLicenseKey (license_to,actvation_code)
**Open document you want to sign
bResult = PDFdoc.Open("C:\temp\Document1.pdf")
IF (bResult ) THEN
WITH PDFdoc
**'/////////////////////////////////////////////////////////////
*!* 'Signer name 1
*!* 'Reason for signing 2
*!* 'Location 4
*!* 'Associated image 8
*!* 'Date of signing 32
*!* 'Signature type 64
*!* 'SignerName
*!* 'This is the friendly name of the digital signature as it appears to the user when the digital certificate is installed
*!* 'on the system. In most cases, this is the full name of the person signing the document.
*!* 'Reason
*!* 'Reason for signing the document. Can be an empty string if no reason
*!* 'is specified.
*!* 'ImageFile
*!* 'Full path of the file containing the image that is associated with the signature.
*!* 'This is optional, a digital signature does not always contain an image.
*!* 'location
*!* 'Physical location of the person who signed the document. This parameter is optional.
*!* 'PageNumber
*!* 'Page number on which to insert the signature. Page numbers start with 1,
*!* 'the value -1 indicates the last page in the document.
*!* 'HorzPos , VertPos
*!* 'Horizontal and vertical position of the digital signature in Twips.
*!* 'Width, Height
*!* 'Width and height of the digital signature in Twips.
*!* 'flags
*!* 'Combination of flags that determine how the digial signature appears on the page. A value of 0 indicates that
*!* 'the signature is invisible.
.DigitalSignature ("Jose Num3","Aprroved", "c:\sign.bmp", "Montreal, Canada", -1, 0, 0, 3000, 3000, 1 + 2 + 4 + 8 + 32 + 64)
.Save ("c:\sample_sign.pdf")
ENDWITH
ENDIF
PDFdoc = 0
RETURN
Below is an activex VFP code snippet which illustrates how to implements Digital Signatures.
Hope this helps?
**Create Document Object
PDFdoc = CREATEOBJECT("CDIntfEx.Document")
PDFdoc.SetLicenseKey (license_to,actvation_code)
**Open document you want to sign
bResult = PDFdoc.Open("C:\temp\Document1.pdf")
IF (bResult ) THEN
WITH PDFdoc
**'/////////////////////////////////////////////////////////////
*!* 'Signer name 1
*!* 'Reason for signing 2
*!* 'Location 4
*!* 'Associated image 8
*!* 'Date of signing 32
*!* 'Signature type 64
*!* 'SignerName
*!* 'This is the friendly name of the digital signature as it appears to the user when the digital certificate is installed
*!* 'on the system. In most cases, this is the full name of the person signing the document.
*!* 'Reason
*!* 'Reason for signing the document. Can be an empty string if no reason
*!* 'is specified.
*!* 'ImageFile
*!* 'Full path of the file containing the image that is associated with the signature.
*!* 'This is optional, a digital signature does not always contain an image.
*!* 'location
*!* 'Physical location of the person who signed the document. This parameter is optional.
*!* 'PageNumber
*!* 'Page number on which to insert the signature. Page numbers start with 1,
*!* 'the value -1 indicates the last page in the document.
*!* 'HorzPos , VertPos
*!* 'Horizontal and vertical position of the digital signature in Twips.
*!* 'Width, Height
*!* 'Width and height of the digital signature in Twips.
*!* 'flags
*!* 'Combination of flags that determine how the digial signature appears on the page. A value of 0 indicates that
*!* 'the signature is invisible.
.DigitalSignature ("Jose Num3","Aprroved", "c:\sign.bmp", "Montreal, Canada", -1, 0, 0, 3000, 3000, 1 + 2 + 4 + 8 + 32 + 64)
.Save ("c:\sample_sign.pdf")
ENDWITH
ENDIF
PDFdoc = 0
RETURN
Example VFP
Thanks to everybody.
Here I send a code that work perfectly.
* A Professional version of the PDF Creator is needed to use Digital Signature.
* You need to have a valid Signature on your system to be able to sign the document
PUBLIC CreatorRef
CreatorRef = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
PUBLIC obj as ACPDFCREACTIVEX.acObject
PUBLIC Licensee
Licensee = "PDF Creator Evaluation License"
PUBLIC ActivationCode
ActivationCode = "07EFCD...8DDE901C19E9326"
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)
Here I send a code that work perfectly.
* A Professional version of the PDF Creator is needed to use Digital Signature.
* You need to have a valid Signature on your system to be able to sign the document
PUBLIC CreatorRef
CreatorRef = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
PUBLIC obj as ACPDFCREACTIVEX.acObject
PUBLIC Licensee
Licensee = "PDF Creator Evaluation License"
PUBLIC ActivationCode
ActivationCode = "07EFCD...8DDE901C19E9326"
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)
When i try to sign with my developer version 3.0 the pdf, i always get an error in the pdf file. In this case the sign is invisible.
With my professinal version 2.5 i can sign the pdf, but when i set some parameters like width, hpos, vpos, .. and image to the signature options, the pdf have problem too.
I suposse i can sign the pdf files without buy the creator.
Thnaks
orlando R.
With my professinal version 2.5 i can sign the pdf, but when i set some parameters like width, hpos, vpos, .. and image to the signature options, the pdf have problem too.
I suposse i can sign the pdf files without buy the creator.
Thnaks
orlando R.