public CellsService(string appSid, string appKey) : base(appSid, appKey) { AppSid = appSid; AppKey = appKey; WorksheetColumns = new CellsWorksheetColumn(AppSid, AppKey); Autoshapes = new CellsAutoshape(AppSid, AppKey); BarCodes = new CellsBarCode(AppSid, AppKey); ChartArea = new CellsChartArea(AppSid, AppKey); Charts = new CellsChart(AppSid, AppKey); Hypelinks = new CellsHypelink(AppSid, AppKey); OleObjects = new CellsOleObject(AppSid, AppKey); Pictures = new CellsPicture(AppSid, AppKey); Properties = new CellsProperties(AppSid, AppKey); SaveAs = new CellsSaveAs(AppSid, AppKey); Workbook = new CellsWorkbook(AppSid, AppKey); Worksheets = new CellsWorksheet(AppSid, AppKey); WorksheetValidations = new CellsWorksheetValidation(AppSid, AppKey); PivotTable = new CellsPivotTable(AppSid, AppKey); }
public void Cells_Pictures_Tests() { try { storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/cells-sample.xlsx", Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx"); CellsPicturesResponse CellsPicturesResponse = cellsService.Pictures.ReadWorksheetPictures(name, "sheet3", Utils.CloudStorage_Output_Folder); CellsPicture cellsPicture = new CellsPicture(); cellsPicture.AlternativeText = "Aspose"; cellsPicture.BorderLineColor = new Color(5, 5, 5, 5); cellsPicture.BorderWeight = 2; cellsPicture.Height = 100; cellsPicture.Width = 100; cellsPicture.SourceFullName = Utils.CloudStorage_Input_Folder + "/signature.jpg"; CellsPicturesResponse CellsPicturesResponse2 = cellsService.Pictures.AddANewWorksheetPicture(name, "sheet1", 1, 1, 5, 5, Utils.CloudStorage_Input_Folder + "/signature.jpg", cellsPicture, Utils.CloudStorage_Output_Folder); cellsService.Pictures.GetWorksheetPictureByNumber(name, "sheet3", 0, CellsPictureFormat.Png, Utils.Local_Output_Path + "cells-picture-out.png", Utils.CloudStorage_Output_Folder); CellsPicture cellsPicture2 = new CellsPicture(); cellsPicture2.BorderLineColor = new Color(5, 5, 5, 5); cellsPicture2.BorderWeight = 2; cellsPicture2.OriginalHeight = 100; cellsPicture2.OriginalWidth = 5; cellsPicture2.ImageFormat = "Png"; cellsPicture2.SourceFullName = Utils.CloudStorage_Input_Folder + "/signature.jpg"; cellsPicture2.Name = "Aspose"; cellsPicture2.MsoDrawingType = string.Empty; cellsPicture2.AutoShapeType = string.Empty; cellsPicture2.Placement = string.Empty; cellsPicture2.UpperLeftRow = 100; cellsPicture2.Top = 100; cellsPicture2.UpperLeftColumn = 100; cellsPicture2.Left = 100; cellsPicture2.LowerRightRow = 100; cellsPicture2.Bottom = 100; cellsPicture2.LowerRightColumn = 100; cellsPicture2.Right = 100; cellsPicture2.Width = 100; cellsPicture2.Height = 100; cellsPicture2.X = 100; cellsPicture2.Y = 100; cellsPicture2.RotationAngle = 190; cellsPicture2.HtmlText = string.Empty; cellsPicture2.Text = string.Empty; cellsPicture2.AlternativeText = string.Empty; cellsPicture2.TextHorizontalAlignment = string.Empty; cellsPicture2.TextHorizontalOverflow = string.Empty; cellsPicture2.TextOrientationType = string.Empty; cellsPicture2.TextVerticalAlignment = string.Empty; cellsPicture2.TextVerticalOverflow = string.Empty; cellsPicture2.IsGroup = false; cellsPicture2.IsHidden = false; cellsPicture2.IsLockAspectRatio = false; cellsPicture2.IsLocked = false; cellsPicture2.IsPrintable = false; cellsPicture2.IsTextWrapped = false; cellsPicture2.IsWordArt = false; cellsPicture2.LinkedCell = string.Empty; cellsPicture2.ZOrderPosition = 0; //cellsService.Pictures.UpdateWorksheetPictureByIndex(name, "sheet3", 0, Utils.CloudStorage_Output_Folder, cellsPicture2); cellsService.Pictures.DeleteAPictureObjectInWorksheet(name, "sheet3", 0, Utils.CloudStorage_Output_Folder); cellsService.Pictures.DeleteAllPicturesInWorksheet(name, "sheet3", Utils.CloudStorage_Output_Folder); storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx", Utils.Local_Output_Path + "/cells-sample.xlsx"); } catch (Exception ex) { Assert.Fail(ex.Message); } }