public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); string fileName = "Sample_Test_Book.xls"; string format = "png"; int? from = null; int? to = null; int? horizontalResolution = null; int? verticalResolution = null; string storage = null; string folder = null; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to split excel workbooks SplitResultResponse apiResponse = cellsApi.PostWorkbookSplit(fileName, format, from, to, horizontalResolution, verticalResolution, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Workbook is splited!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "input.pdf"; String format = "pdf"; int from = 1; int to = 2; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.PDF Cloud SDK API to split pdf files SplitResultResponse apiResponse = pdfApi.PostSplitDocument(fileName, format, from, to, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Split PDF Files, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }