Write PDF from base64-String
Posted: Thu Oct 07, 2021 1:44 pm
I get a PDF as bases64 and just need to write a pdf from that.
How can I make this in a Legacy Script?
My code so far:
The scripts just writes the string to the file. Which then of course cant be opened.
How can I make this in a Legacy Script?
My code so far:
Code: Select all
function jobArrived( s : Switch, job : Job )
{
const base64Label = "JVBERi0xLjQKJeLjz9MKMyAwIG9i............";
const path = job.createPathWithName("DPDLabel.pdf");
var ba = new ByteArray( base64Label, "UTF-8");
File.writeByteArray(path, ba);
job.sendToSingle(path);
}