Got more questions? Find advice on: SQL | XML | Regular Expressions | Windows
in Search
Welcome to AspAdvice Sign in | Join | Help

Convert Excel XLS file to PDF

Last post 02-18-2009, 7:03 AM by aspose_seo. 0 replies.
Sort Posts: Previous Next
  •  02-18-2009, 7:03 AM 50998

    Convert Excel XLS file to PDF

    This technical tip shows how to convert an Excel XLS file to PDF even if it contains any images or charts within it. You will be using Aspose.Cells and Aspose.Pdf libraries for XLS2PDF conversion. Please also make sure to save your Aspose.Pdf XML file on disk, not in a stream because Aspose.Pdf XML file is being used as a medium to preserve those image files.

    [C#]

    // Saving an XLS file in Aspose.Pdf xml format
    Workbook wb = new Workbook();
    wb.Open("C:\\book1.xls);
    wb.Save("C:\\xls2pdf.xml", FileFormatType.AsposePdf);

    // Converting XLS file to PDF through Aspose.Pdf using Aspose.Pdf xml file as a medium
    Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
    pdf.BindXML("c:\\xls2pdf.xml", null);
    pdf.Save("C:\\xls2pdf.pdf");

    [VB]

    ' Saving an XLS file in Aspose.Pdf xml format
    Dim wb as Workbook = new Workbook()
    wb.Open("C:\book1.xls)
    wb.Save("C:\xls2pdf.xml", FileFormatType.AsposePdf)

    ' Converting XLS file to PDF through Aspose.Pdf using Aspose.Pdf xml file as a medium
    Dim pdf as Aspose.Pdf.Pdf = new Aspose.Pdf.Pdf()
    pdf.BindXML("c:\\xls2pdf.xml", null)
    pdf.Save("C:\xls2pdf.pdf")

    More about Aspose.Cells

    More about Aspose.Pdf

    Contact Information
    Suite 119, 272 Victoria Avenue
    Chatswood, NSW, 2067
    Australia
    Aspose - The .NET and Java component publisher
    sales@aspose.com
    Phone: 888.277.6734
    Fax: 866.810.94651

View as RSS news feed in XML