How to encode base64 in Delphi 6? [duplicate]
问题 This question already has answers here : Binary to Base64 (Delphi) (2 answers) Closed 6 years ago . I need to encode a pdf document to base64 in Delphi6. Can anyone help me? 回答1: You can use the EncdDecd unit that is supplied with Delphi. The function you need is EncodeStream . You simply need to create two streams, one for input and one for output. If you are working with files then you should create TFileStream instances. Once you have your two file streams created, all you need is: