Ionic 2 display pdf stored in dataDirectory using pdf js

I try to display pdf stored in the dataDirectory of the device first it converts into Uint8Array I used this method and pass the path of pdf

base64ToUint8Array(base64) {
var raw = atob(base64);
var uint8Array = new Uint8Array(raw.length);
for (var i = 0; i < raw.length; i++) {
uint8Array[i] = raw.charCodeAt(i);
}
console.log(“data…”, JSON.stringify(uint8Array));
return uint8Array;
}

got the error : ERROR DOMException: Failed to execute ‘atob’ on ‘Window’: The string to be decoded is not correctly encoded.