function saveAsFile(fileName, bytesBase64) {

    var link = document.createElement('a');

    link.download = fileName;

    link.href = 'data:application/pdf;base64,' + bytesBase64;

    document.body.appendChild(link);

    link.click();

    document.body.removeChild(link);


}