The code you've posted is for Angular - completely different framework with completely different architecture and syntax. I'm posting again my previous reply:
In short. You need to use NavigationManager NavigateTo() with forceLoad = true to request a controller where you can return a file. You will need an additional parameter to retrieve the relevant record/field value.




