Can anyone share work experience on this subject (tools used, etc) ?
I need to digitally sign eInvoices with signature and timestamp.
The files can be pdf or xml eInvoice format.
Antonio
Regards
Antonio H Ferreira
Antonio H Ferreira
Can anyone share work experience on this subject (tools used, etc) ?
I need to digitally sign eInvoices with signature and timestamp.
The files can be pdf or xml eInvoice format.
Antonio
I am interested in this topic also.
Regards,
James
/* if signing a pdf then, it is assumed that the signature class is the name of the
pdf without the pdf extension. If there is no path declaration in the class definition
then the pdf document must exist on the same path where the system ini file is stored.
*/
#include "fivewin.ch"
//------------------------------------------------------------------------//
CLASS TePad
DATA oActiveX
DATA oSearch
DATA oWnd
DATA cCaption AS CHARACTER INIT "Capture Signature"
DATA cDispName AS CHARACTER INIT "Not Set"
DATA cDevice
DATA cPdf
DATA hDLL
DATA aGetFlds AS ARRAY INIT { "mrecno", ;
"dt_stamp", ;
"class", ;
"sign_data", ;
"operator" }
METHOD New()
METHOD SetProp()
METHOD PickUpSignature()
METHOD End()
METHOD SaveToJpg()
METHOD GetSigData()
ENDCLASS
//------------------------------------------------------------------------//
METHOD New( oOwner, oProcess ) CLASS TePad
local lOk := .t.
local oErr
local cEvents := ""
TRY
::oActiveX := GETACTIVEOBJECT( "esW25COM.esCapture.1" )
CATCH
TRY
::oActiveX := CREATEOBJECT( "esW25COM.esCapture.1" )
CATCH
Alert( "ERROR! SigningPad not avialable. [" + Ole2TxtError()+ "]" )
::end()
Return Nil
END
END
// ::oActiveX := TActiveX():New( , "esW25COM.esCapture.1" )
// ::cDevice := ::oActiveX:GetProp( "ConnectedDevice" )
// ::oClient := ::oActiveX
// ::oActiveX:bOnEvent := { |e, a| logfile( "trace.log", {EventInfo( e, a ) } ) }
/*----------------------------------------------------------------------------
ConnectedDevice =
{98C174D3-6D2A-4509-96DB-D5B34FA7A561}: Interlink ePadInk
{7FCD9512-8763-436E-8747-40972EE28EFD}: Interlink ePad
{C55C5D54-8A92-48AD-A32F-1FC58092A581}: Interlink ePadID
------------------------------------------------------------------------------
CATCH oErr
::end()
Return Nil
END*/
/* ::bInit := { |o| o:hide() }
::bValid := { || .f. }
::Activate() */
RETURN Self
//------------------------------------------------------------------------//
METHOD SetProp() CLASS TePad
::oActiveX:SetProp( "SignDlgCaption", ::cCaption )
::oActiveX:SetProp( "DisplayName", ::cDispName )
::oActiveX:SetProp( "ShowSignerName", 1 ) //true
::oActiveX:SetProp( "EnableAntiAliasing", 1 )
RETURN NIL
//------------------------------------------------------------------------//
METHOD PickUpSignature() CLASS TePad
local nRet
TRY
::oActiveX:Do( "ClearSign" )
::oActiveX:Do( "StartSign" , 0, 1 )
CATCH
logfile( "trace.log", {"catched with errors"})
END
Logfile( "trace.log", { "Just testing", ::cDevice } )
Return nRet
//------------------------------------------------------------------------//
METHOD End() CLASS TePad
logfile( "trace.log", {"ending TePad" } )
if ::oActiveX <> Nil .and. ValType( ::oActiveX ) == "O"
// ::oActiveX:Do( "CloseConnection" )
endif
iif( ::hDLL <> NIL, FreeLibrary( ::hDLL ), )
DeleteObject( ::oSearch )
DeleteObject( ::oActiveX )
DeleteObject( ::oWnd )
DeleteObject( Self )
RETURN Nil
//------------------------------------------------------------------------//
METHOD SaveToJpg() CLASS TePad
local cFile := Temp_Name( "jpg" )
// ::oActiveX:Do( "SaveToFile", cFile, nheight, nwidth, 1 )
Return Nil
//------------------------------------------------------------------------//
METHOD GetSigData() CLASS TePad
/*Private Function GenerateSignImage() As Boolean
Dim strSignData As String
strSignData = esCapture1.GetSignData
If strSignData <> vbNullString Then
strSignImgData = esCapture1.GetImageData(167, 87, cmbImageType1.ListIndex, 0)
'get the signature data from the database and display it on the picture box
esCapture1.GenerateImageFromBase64 strSignImgData, strSigImgPath
Set picSign.Picture = LoadPicture(strSigImgPath)
If Trim(txtFolderName.Text) <> vbNullString Then
Select Case cmbImageType1.ListIndex
Case 0:
FileCopy strSigImgPath, txtFolderName.Text & "\" & txtSignerName.Text & "Signature.bmp"
Case 1:
FileCopy strSigImgPath, txtFolderName.Text & "\" & txtSignerName.Text & "Signature.jpg"
Case 2:
FileCopy strSigImgPath, txtFolderName.Text & "\" & txtSignerName.Text & "Signature.gif"
End Select
End If
GenerateSignImage = True
End If
esCapture1.CloseConnection
End Function
*/
Return Nil
//------------------------------------------------------------------------//
static function EventInfo( e, a )
local cMsg := "Event:" + cValToChar( e ) + CRLF
local n
cMsg += "Parms:"
for n:=1 to Len ( a )
cMsg += cValToChar( a[n] ) + CRLF
next n
return cMsg + CRLF
//------------------------------------------------------------------------//