Directly Converting Excel Files to Pdf with Aspose.Cells

Share on FacebookTweet about this on TwitterShare on LinkedIn

In previous versions, converting Excel files to Pdf needs two components: Aspose.Cells and Aspose.Pdf. With the new version v4.7.0, users can use Aspose.Cells for .NET only to implement this feature. This new change greatly optimizes speed and memory usage.

You will utilize the overloaded Save method of the Workbook class providing the FileFormatType.Pdf enum member that converts the native excel file to pdf format.

The above steps are implemented in the following example.

Example:

[C#]

 

//Instantiate the Workbook object

Workbook workbook = new Workbook();

 

//Open an excel file

workbook.Open(“f:\\test\\Input.xls”);

 

//Save the document in Pdf format

workbook.Save(f:\\test\\Output.pdf, FileFormatType.Pdf);

 

[VB.NET]

 

‘Instantiate the Workbook object

Dim workbook As Workbook = New Workbook()

 

Open an excel file

workbook.Open(“f:\test\Input.xls”)

 

‘Save the document in Pdf format

workbook.Save(f:\test\Output.pdf, FileFormatType.Pdf)

 

Please download and try the new version at: 

http://www.aspose.com/community/files/51/file-format-components/aspose.cells-for-.net-and-java/default.aspx .