Posts

Showing posts from October, 2024

Power Apps: Using Collections

Image
Microsoft Power Apps is a suite of applications, services, and a is also a data platform. The best use of the Power Apps is that it offers a rapid development environment to build custom applications as per the business needs. Power Apps are extremely useful when your business user needs a customized application instantly as per the need e.g. Construction Supervisor needs an application where he needs to enter in and out time of Construction worker. A Doctor just needs a small and handy application where he can enter medicine subscribed details to the patient. In these cases, although we can provide a web interface application or may be a mobile application to such business users, but these types of apps take a time to develop with high interactive UI using various server-Side as well as Front-End technologies like ASP.NET Core, Angular, React, etc. But what if the customer only needs a simple but yet powerful UI application with desired functionality? The Power Apps is the solution fo

ASP.NET Core 8: Sending PDF Files from ASP.NET Core API to Angular Client and Open the PDF File in Angular Application

Image
In this article, we will implement the mechanism of sending the PDF file from ASP.NET Core API to Angular client application. The Angular client application will download will open this PDF file directly in the browser. It is always important to show the data stored in PDF document from server application to the client application without explicitly downloading it on the client (User may take a call to further save it). In ASP.NET Core we can make use of the Results  class and its File() method to send file from API in the HTTP GET response. This file response can be received by the Angular Client application in the BLOB response type. In the Angular application, we can use the createObjectURL() method of the window.URL interface object to create string URL so that the file can be directly opened in the browser. The Figure 1 shows the implementation type. Figure 1: The Implementation In ASP.NET Core, we cand use the File() method of the Result class to write the Stream into the HTTP Re