This video shows you how to manage binary data (PDF files in this case) in an Apex Designer app:
Here is the upload behavior code snippet:
const file = this.fileUploadInput.nativeElement.files[0];
debug('file', file);
let reader: FileReader = new FileReader();
reader.onload = async () => {
debug('reader.result', reader.result);
const base64 = ('' + reader.result).substr(('data:' + file.type + ';base64,').length);
debug('base64', base64);
await this.pdfDocuments.add({
fileName: file.name,
size: file.size,
base64Content: base64
});
this.fileUploadInput.value = null;
await this.pdfDocuments.read();
};
reader.readAsDataURL(file);
This video shows you how to view PDFs in an Apex Designer app: