AC TIP | Convert Base64 to PDF in delivery

in  ACC Tips & Tricks, Adobe Campaign
1 minute read
Adobe campaign tips and tricks

Today I have a quick tip on how to convert data encoded in Base64 to PDF using JSAPI in Adobe Campaign Classic. AC can not directly attach Base64 attachment to the email:

data:applcation/pdf;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA

For this we need to first decode incoming file with the use of memory buffer and save it as file. Then such file can be referenced while attaching files for each recipient dynamically.

There are not much of practical examples on almost all functions described within JSAPI documantation, but a little bit of googling around I have found a nice example for memory buffer

var memBuff = new MemoryBuffer(),
    f = new File("path/to/export/test.pdf");

memBuff.appendBase64('JVBERi0xLBzb ... Cg==');"a");

Leave a comment

Your email address will not be published. Required fields are marked *