I am trying to convert excel output to pdf. The content is generated programmatically and then I am trying to get the output as pdf. I am using the below code. (NOTE: excel is Worksheet object. )
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf()
excel = Nothing
Response.AddHeader("Content-Disposition", "attachment; filename=report.PDF")
Response.ContentType = "application/pdf"
The promt to open PDF file is coming, but when I click on Open I get the error message: "Adobe Reader could not open 'report.PDF' because it is either not a supported file type or because the file has been damaged."
Can anyone help. Thanks in advance.