Export WORKSHEET to XPS from Excel

C# library for exporting WORKSHEET to XPS file

Use Export API of Cells Cloud to export Excel file internal object workflows in Net. This is a professional solution to export WORKSHEET to XPS format file from spreadsheet online using C#.

Export WORKSHEET object to XPS format file using Cells Cloud SDK for C#

API
POST
https://api.aspose.cloud/v3.0/cells/export

Export WORKSHEET object to XPS file from Excel file is a complex task. Export WORKSHEET to XPS format transitions is performed by our C# SDK while maintaining the source WORKSHEET spreadsheet's main structural and logical content. Our C# library is a professional solution to export WORKSHEET objects to XPS format files online. This Cloud SDK gives C# developers powerful functionality and perfect XPS output.

Code example in C# using REST API to export WORKSHEET to XPS format from spreadsheet

// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
    string format = "xps";
    string objectType ="worksheet";
    LightCellsApi lightCellsApi =
        new LightCellsApi(Environment.GetEnvironmentVariable("ProductClientId"), Environment.GetEnvironmentVariable("ProductClientSecret"));
    IDictionary<string ,Stream> files = new  Dictionary<string ,Stream>();
    files.Add("Book1.xlsx" , File.OpenRead("Book1.xlsx"));
    files.Add("myDocument.xlsx", File.OpenRead("myDocument.xlsx"));
    var filesResult = lightCellsApi.PostExport(files, objectType, format);
    foreach (var file in filesResult.Files)
    {
        string v = file.FileContent;
        string filename = file.Filename;
        byte[] workbookData = System.Convert.FromBase64String(v);
        MemoryStream memoryStream = new MemoryStream(workbookData, 0, workbookData.Length);
        memoryStream.Seek(0, SeekOrigin.Begin);
        using (FileStream fileStream = File.Create( filename))
        {
            fileStream.Position = 0;
            memoryStream.CopyTo(fileStream);
            fileStream.Close();
        }
    }

How to use Cells Cloud SDK for Net to export objects from Excel WORKSHEET to XPS

  1. Register an account at Dashboard to get free API quota & authorization details
  2. Initialize the Cells API with your Client ID, Client Secret, Base URL, and API version.
  3. Use the `postExport` method to retrieve the resulting stream.

System Requirements

  1. NET Framework 4.5.2 or newer
  2. Net Standard 2.0 or newer