Follow on Google News News By Tag Industry News News By Location Country(s) Industry News
Follow on Google News | How to convert Excel files to PDF inside .NET?Our developer’s group have got interesting query from a customer. They have to create an online converter of excel files to PDF on the corporate website!
By: Yana The problem was this: client’s company keeps on its server statistics reports in xls/xlsx, which had to be displayed on browser by customer's request. User which sees report must have no possibility of making any changes and editing. Therefore they decided to export Excel files into PDF format, since most modern browsers have the ability to display it. To solve the exporting problem, we offered to our client «Excel to PDF .Net» component which can convert at server side. The component has satisfied customer requirements: Our developer’s group has prepared this code to the customer: SautinSoft.ExcelToPdf x = new SautinSoft.ExcelToPdf(); byte[] excelBytes = … //get Excel byte stream here byte[] pdfBytes = null; int i = x.ConvertBytes( //show PDF if (pdfBytes != null) { Response.Buffer = true; Response.Clear(); Response.ContentType = "application/ Response.AppendHeader(" Response.BinaryWrite( Response.Flush(); Response.End(); } By clicking the button «Print to PDF», server gets a query to convert corresponding xls/xlsx file. Next the component makes conversion to PDF at server side and returns PDF document to client’s browser. Browser displays this PDF to user or offer to save it on HDD. The problem is solved! End
Account Email Address Account Phone Number Disclaimer Report Abuse
|
|