How to convert a pdf file into base64 string

How to convert a file into base64 string.

I want to convert the pdf file to base64 in pega please share the steps

@RaghavN2

The below snippet retreives the base 64 content.

D_AttachmentContent[AttachInsKey:.ExtractClaimsData.pxAttachmentKey,PopulateAttachStream:"true"]. pyAttachStream

Please check this article for more details

@RameshSangili can you please how to do it in activity. i have list of documents in documentlist and which ever i select it form UI checbox it has to be covert into base64 format and sent to docusign as input parameter