1
Good morning.
I am working with Angularjs version 1.5, and am having trouble generating PDF. Response receives a byte array would like some help.
this.TesteService.relatorio().$promise.then((response) => {
console.log('response',response);
var array = Object.values(response);
console.log('array',array);
var file = new Blob(array, {type: 'application/pdf'});
console.log('file',file);
var fileURL = URL.createObjectURL(file);
console.log('fileURL',fileURL);
this.$window.open(fileURL);
});
As I do currently displays the file sheets but they are blank and error occurs:
Error: Command token Too long: 128
Try it this way:
var pdfAsDataUri = "data:application/pdf;base64,"+array ;
window.open(pdfAsDataUri);
– Sorack
It didn’t work, a new window opens but nothing appears. As I do currently displays the sheets of the file but they are blank and error occurs Error Error: Command token Too long: 128
– Luiz Rita
Add this information to the question. Apparently this bug you reported is a bug from
Acrobat Reader
– Sorack
All right I’ll add.
– Luiz Rita