Above answer from @BenGeeBee did not work for me. However I found solution under ngx-extended-pdf-viewer repo in GitHub comment.
My application is running .NET 8, so adding below to program.cs file fixed the issue.
var provider = new FileExtensionContentTypeProvider();
provider.Mappings[".ftl"] = "text/plain";
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider
});