How to create pdf/excel without saving in server path
I have a Web API project which is developed by C# that is running on a server, and my Client technology is developed by Angular 2. Now, I have a requirement of doing Reports, I am not clear where to create the PDF/excel whether in Server or Client side. If Server, why? & if Client, why? which approach is a best practice. And if you suggest it as Server, there could be possibilities of moving the Server or achieving load balance with different server at that time its not fine to copy all the PDF/Excel. Kindly suggest which technology is preferred and which side is we need to code to download. orelse its better to sent the JSON format to client side technology? Thanks in advance for helping.
Maen BadwanPosted Nov 9, 2017, 12:07 PM
I noticed that you don’t want to keep any copy locally at the server-drive. In this case, you have to options in my opinion:
1. Create the PDF or Excel file and save it as binary data in database. But this will consume the size of the database.
2. Alternatively, you can create the PDF or Excel report at the server side, save it temporally to disk, and then use a programming toolkit that supports loading PDF/Excel files and save them as web-friendly format such as JPEG or PG image.
LEADTOOLS programming SDK can load and rasterize PDF and Excel files (convert the document to image) and save them as JPEG, PNG, BMP, etc.
And finally, remove the PDF or Excel file from the server-drive, save the images into database as base64 string, and then remove the images from the server.
I hope this helps!