Excel Save - Aspose PDF


#1

Hello,

I’ve download both Aspose.Excel and Asspose.Pdf and have manged to save an Excel file as XML and then converted it to a PDF. However this saves/converts the whole Excel workbook. Is it possible to save to save a cellrange and convert this?

Aspose.Excel.Excel excel = new Aspose.Excel.Excel();

Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();

excel.Open(@“C:\Work\Testing\Allsorts\Comments.xls”);

excel.Save(@“C:\Work\Testing\Allsorts\comment.xml”,FileFormatType.AsposePdf);

pdf.BindXML(@“C:\Work\Testing\Allsorts\comment.xml”,null);

pdf.Save(@“C:\Work\Testing\Allsorts\comment.pdf”);


#2

You can set Print Area for that cell range. Then only that range of cells will be converted.


#3

Do you mean by opening excel and setting print area or can this be done by the Aspose.Excel component.


#4

These two approaches should all work.