Hi Claudiu,
Thank you for providing the sample application.
We will look into the direct XLS2PDF conversion using File Streams. Currently, as a work around, either you can save the XLS file to PDF directly without using the File Stream (wb.Save("c:\\MyPDF.PDF", FileFormatType.Pdf)) or you can use Aspose.Cells and Aspose.PDF combination to generate a PDF from XLS using File Stream. Please see the following sample code in this regard,
Sample Code:
Workbook wb = new Workbook();
wb.Worksheets.Clear();
Worksheet ws1 = wb.Worksheets.Add("shee1");
ws1.Cells[0, 0].PutValue("SampleHeader1");
ws1.Cells[0, 2].PutValue("SampleHeader2");
wb.Save("c:\\MySpreadsheet2.xml", FileFormatType.AsposePdf);
using (FileStream fs = File.Create(@"C:\sample2.pdf"))
{
Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf(fs);
pdf1.BindXML("c:\\MySpreadsheet2.xml", null);
pdf1.Close();
fs.Close();
}
Thank You & Best Regards,
Nausherwan Aslam
Support Developer,
Aspose Sialkot Team
Contact Us