Binary PDF stream to Blob

function GenPDF(){

    var request = new XMLHttpRequest();

    request.open("POST", url_, false);

    // request.responseType = "blob";

    request.setRequestHeader('Content-type', 'application/json');

    request.setRequestHeader('Api-Key', api_key);

    // request.setRequestHeader("Content-Disposition", "attachment: filename=file.pdf");

    request.onload = function (e) {

      console.log('status: '+this.status);

        if (this.status === 200) {

          var res = this.response;

            var datas = stringToArrayBuffer(res);

            var blob = new Blob([datas], { type: 'application/pdf'});

            pdfResponse = (URL||webkitURL).createObjectURL(blob);

        }

    };

    request.send(data);

};

function stringToArrayBuffer(str) {

    var buf = new ArrayBuffer(str.length);

    var bufView = new Uint8Array(buf);

    for (var i=0, strLen=str.length; i<strLen; i++) {

        bufView[i] = str.charCodeAt(i);

    }

    return buf;

}

any one already made it. its working before Month of November. it is replicated or appgyver problem or something? thank you.

Blob result: blob:https://platform.preview.appgyver.com/e2ba037b-2eb4-459a-995c-7ae982237626

Hi!

I’m sorry, I don’t fully understand – are you saying you had this working in a previous version, but it doesn’t work anymore? If so, it sounds like a regression bug, please report it at our bug tracker!