PDF to Base64 using filechooser

Hi everybody:

I saw to other post get the base 64 files, but i didn’t get it work, the other solutions i get no show when the developer is using chooserFile
Other thing, is readAsDataURL, i get not work with file or FileReader.

Can you help me please, thank you

Here is my code:

let res:any = await (await this.file.resolveLocalFilesystemUrl(fileFromPath)).nativeURL;
let filename = String(res).substring(String(res).lastIndexOf('/') + 1);
let url = String(res).substring(0, String(res).lastIndexOf('/'));
const result = await this.file.readAsDataURL(url, filename);
console.log("RESULT: " +  result);