Origen de la fuente: http://online-help.sageerpx3.com/erp/12/wp-static-content/static-pages/en_US/v7dev/api-guide_api-pdfsignature.html
The PDF signature API provides a function that signs a PDF file with a certificate stored in the Syracuse server. The function can be called from the 4GL with the code hereunder.
The function name is pdfsign
.
PDF signature call
#**
#* This function signs a PDF file using a certificate defined in the Syracuse administration.
#*
#* @param PDFNAME : Char : PDF name
#* @param DATA : Clbfile : Content encoded in base 64
#* @param CERTNAME : Char : Name of the certificate to use defined in the Syracuse administration
#* @param FUTURE : Integer : Set to 1 to be called in 'future' mode or 0 for the 'wait' mode
#* @param RESHEAD : Clbfile : Response header
#* @param RESBODY : Clbfile : Signed PDF content
#* @return STATUSCODE : Integer : Status code returned by the javascript runner module
#*!
Funprog PDFSIGN(PDFNAME, DATA, CERTNAME, FUTURE, RETURNS, RESHEAD, RESBODY)
Value Char PDFNAME
Value Clbfile DATA
Value Char CERTNAME
Value Integer FUTURE
Value Char RETURNS
Variable Clbfile RESHEAD()
Variable Clbfile RESBODY()
Local Integer STATUSCODE
Local Char MODULE(100) : MODULE = '$pdf'
Local Char FONCTION(30) : FONCTION = 'sign'
Local Char MODE(10)
If (FUTURE = 1) : MODE = 'future' : Else : MODE = 'wait' : Endif
Local Clbfile ARGUMENTS(0)
ARGUMENTS = '"' + PDFNAME + '","' + DATA + '","' + CERTNAME + '", {"returnData": true, "encoding": "base64"}'
Local Clbfile RESBODY(0)
# Call 'sign' function
STATUSCODE = func ASYRWEBSER.EXEC_JS(MODULE, FONCTION, MODE, ARGUMENTS, '0,1,0,0', 0, RETURNS, '0', RESHEAD, RESBODY)
End STATUSCODE
If STATUSCODE is set to 200, RESBODY will contain the signed PDF.For further information, consult our ASYRWEBSER API documentation.