How to convert a pdf to base64 to use in the XMLWriterService
Posted: Fri Oct 15, 2021 1:48 am
I have a pdf that that must be converted in to base64 so it can be mapped into an xml element with the XMLWriterService.
From the Lansa Integrator documentation i understand it can be done by the HashService:
5.8.3 HASH
The HASH command generates the hash of the specified field or file. The hash value is returned in the command message response field
I tried this in integrator with :
HASH FILE(/tmp/NL00000007.PDF) HASHENCODING(*BASE64)
Although the message response field is long enough it contains only 28 characters.
It is not clear to me what parameters are to be used or if this is even the right way to do this.
Any suggestions?
From the Lansa Integrator documentation i understand it can be done by the HashService:
5.8.3 HASH
The HASH command generates the hash of the specified field or file. The hash value is returned in the command message response field
I tried this in integrator with :
HASH FILE(/tmp/NL00000007.PDF) HASHENCODING(*BASE64)
Although the message response field is long enough it contains only 28 characters.
It is not clear to me what parameters are to be used or if this is even the right way to do this.
Any suggestions?