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 sheetName = "Sheet4"; int autoshapeNumber = 1; String storage = ""; String folder = ""; 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 get autoshape from worksheet AutoShapeResponse apiResponse = cellsApi.GetWorksheetAutoshape(fileName, sheetName, autoshapeNumber, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { AutoShape autoShape = apiResponse.AutoShape; Console.WriteLine(autoShape.HtmlText); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public void Cells_Autoshapes_Tests() { try { AutoShapesResponse autoShapesResponse = cellsService.Autoshapes.GetWorksheetAutoshapesInfo(name, "sheet2", Utils.CloudStorage_Input_Folder); AutoShapeResponse autoShapeResponse = cellsService.Autoshapes.GetAutoshapeInfo(name, "sheet2", 0, Utils.CloudStorage_Input_Folder); cellsService.Autoshapes.GetAutoshapeInSomeFormat(name, "sheet2", 0, CellsAutoshapeFormat.Jpeg, Utils.CloudStorage_Input_Folder, Utils.Local_Output_Path + "\\out.jpeg"); } catch (Exception ex) { Assert.Fail(ex.Message); } }
static void Main() { string dataDir = Common.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string input = "sample1.xlsx"; Common.StorageService.File.UploadFile(dataDir + input, input, storage: Common.STORAGE); string sheetName = "Sheet1"; AutoShapeResponse apiResponse = Common.CellsService.Autoshapes.GetAutoshapeInfo(input, sheetName, 0, Common.FOLDER, storage: Common.STORAGE); Console.WriteLine(" Autoshape width : " + apiResponse.AutoShape.Width); }