Could you explain why a simple Workbook.SaveToPDF() method hasn't been created? Although the current steps to do this aren't overly cumbersome (Save to xml, create new PDF, bind XML) it seems that it could be done in a single function call.
Since the Save method already accepts the fileType parameter, and one of those options is AsposePDF, perhaps you could just make that work? Please let me know.
Thanks!
Dan
Another option, although not as handy as the one I listed above, would be to overload the SaveToStream method so that it could save the file as XML to a MemoryStream, which could be passed inline to the PDF.BindXML method.
Just a thought...
Dan
Hi Dan,
To convert an xls file to pdf file, you should use two Aspose products: Aspose.Cells and Aspose.Pdf. So it's impossible to provide a single method in Aspose.Cells to do this task.
And we have already provide a Save method to allow you to save file xml to a MemoryStream.
workbook.Save(stream, FileFormatType.AsposePdf);
Alright, but as mentioned in another post, I cannot save to memory stream if I have images in my Excel file and want them preserved in the conversion to PDF. It was stated that the images have to be saved to disk, but I never have to specify where these images are saved to.
So my question is if you are automatically saving the images to a temp location for conversion, why couldn't I still use a memory stream for the XML portion?
Thanks!
Dan
Hi Dan,
When you save the file to disk, image files are saved in the same folder as XML file.
Thanks for your suggestion. We will check if we can save the image files to a temp folder to allow you use MemoryStream for XML portion.