Open base64 PDF

0

I have an application that generates a PDF in bytes and converts it to ToBase64String and sends it through a JSON so that javascript can open, but in chrome it can not read that file and display the PDF

   $.post('/RelatoriosGerais/GerarPDF/', { CategoriaRelatorio: 1 }, function (data) {
                if (data.status = true) {

                    let Pdf = 'data:application/pdf;base64,' + data.arrayByte;
                    window.open(Pdf, '_blank');
}

where data.arrayByte is base 64 that is returned via JSON

NOTE: Firefox works

    
asked by anonymous 16.08.2018 / 19:04

1 answer

0

I think there might be missing the definition of the type of file being rendered .... something like this ...

date: [] [; base64],

Take a look at Mozilla Data_URL ...

link

And also in related RFC ... link

T +

    
16.08.2018 / 20:11