Link Search Menu Expand Document

Export To PDF - C#

Spreadsheet SDK sample in C# demonstrating ‘Export To PDF’

Program.cs
using Bytescout.Spreadsheet;
using System.IO;

namespace XLS2PDF
{
    class Program
    {
        static void Main(string[] args)
        {
            Spreadsheet document = new Spreadsheet();

            // load table from existing XLS file        
            document.LoadFromFile("SimpleReport.xls");

            // add image
            document.Workbook.Worksheets[0].Pictures.Add(5, 1, "image.jpg");

            // save as PDF
            bool autosize = false;
            document.SaveAsPDF("Output.pdf", autosize);

            // close the document 
            document.Close();
        }
    }
}

Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK