Hi,
I am trying to convert a Excel(.xlsx) file to pdf using memory stream. But I am getting ‘The File is Corrupted’ error every time. I am first converting the xlsx file to input stream(Memory Stream) and then passing it to a method.
Below is my code,
Aspose.Cells.PdfSaveOptions soptions = new Aspose.Cells.PdfSaveOptions(SaveFormat.Pdf);
soptions.Compliance = Aspose.Cells.Rendering.PdfCompliance.PdfA1b;
soptions.AllColumnsInOnePagePerSheet = true;
HTMLLoadOptions op = new HTMLLoadOptions(LoadFormat.Xlsx);
LoadOptions loptions = new LoadOptions(LoadFormat.Xlsx);
Inputstream.Seek(0, SeekOrigin.Begin);
Aspose.Cells.Workbook book = new Aspose.Cells.Workbook(Inputstream);
MemoryStream strm = new MemoryStream();
book.Save(strm, soptions);
Please Let me know what is the issue with this(I couldn’t attach my Excel file here)
Thanks,
SubhaS