Free Support Forum -

Convert excel to pdf without first saving excel file or pdf file

is there a way to call


when you haven’t saved the excel file.  
You just want to pass a workbook to it or something like that?
And then stream the pdf back to client.  This is an attempted workaround 
to a problem I discovered in aspase pdf in that it won’t display my images 
in a created from scratch pdf.


Thanks for your posting and using Aspose.Cells.

Aspose.Cellls can only convert your Excel file into pdf , it cannot convert your pdf file into excel. Please see the following documents for your reference. Aspose.Cells cannot convert Excel to pdf without saving.

are there any options when saving a workbook as a pdf? By default it split my table across six pages. It fits all on one page when I create the same pdf using aspose.pdf from scratch. Is there a way to make it all on one page with the saving of workbook as a pdf?


Thanks for your posting and using Aspose.Cells.

Please see the following code ,it would print entire sheet on one page.


String path = “F:\Shak-Data-RW\Downloads\test\sample\sample.xls”;

Workbook workbook = new Workbook(path);

PdfSaveOptions opts = new PdfSaveOptions();

opts.setOnePagePerSheet(true); + “.out.pdf”, opts);

Thank you, that worked. Is there any way to control line breaks in the table headers in excel? Some of the headers are long. When I use aspose.pdf to generate a pdf it reads the line breaks in the messages \n but in excel it just ignores the \n. So when I convert to pdf it still has the long table headers all on one line.

OK, is there a way to turn on the grid lines when converting xcel to pdf. I think I read that somewhere but can’t seem to find it now.


Thanks for your posting and using Aspose.Cells.

You may use the following line of code before saving to pdf.e.g