public static void Main(String[] args) { string APIKEY = "xxxxx"; string APPSID = "xxxxx"; string BASEPATH = "http://api.aspose.com/v1.1"; try { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //string name = "slide_" + new Random().Next(100) + ".pptx"; //string password = null; //string storage = null; //string folder = null; //byte[] file = System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + "test_slide.pptx"); ////System.Diagnostics.Debug.WriteLine("-------------working......"); //ResponseMessage actual; //actual = target.PutNewPresentation(name, password, storage, folder, file); string name = "test_slide.pptx"; int? slideIndex = 1; int? shapeIndex = 1; int? paragraphIndex = 1; int? portionIndex = 1; string folder = null; string storage = null; Portion body = new Portion(); body.Text = "Newer value"; body.FontColor = "#FFFF0000"; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.PutSetParagraphPortionProperties(name, slideIndex, shapeIndex, paragraphIndex, portionIndex, folder, storage, body); System.Diagnostics.Debug.WriteLine("-------------working......"+actual); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("--------------------------------\nException:" + ex.Message + "\n" + ex.StackTrace); } }
public void TestDeleteSlideByIndex() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; int? slideIndex = 1; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); SlideListResponse actual; actual = target.DeleteSlideByIndex(name, slideIndex, folder, storage); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.SlideListResponse(), actual.GetType()); }
public void TestPostAddNewShape() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; int? slideIndex = 1; string folder = null; string storage = null; Shape body = new Shape(); body.Name = "Aspsoe"; body.ShapeType = "Line"; body.AlternativeText = "aspose.com"; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.PostAddNewShape(name, slideIndex, folder, storage, body); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestGetSlidesSlideShapesParent() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; int? slideIndex = 1; string shapePath = "1"; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.GetSlidesSlideShapesParent(name, slideIndex, shapePath, folder, storage); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestGetSlidesPresentationTextItems() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; bool? withEmpty = null; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); TextItemsResponse actual; actual = target.GetSlidesPresentationTextItems(name, withEmpty, folder, storage); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.TextItemsResponse(), actual.GetType()); }
public void TestGetSlidesPlaceholder() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "sample-input.pptx"; int? slideIndex = 1; int? placeholderIndex = 0; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); PlaceholderResponse actual; actual = target.GetSlidesPlaceholder(name, slideIndex, placeholderIndex, folder, storage); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.PlaceholderResponse(), actual.GetType()); }
public void TestPostSlidesSaveAsTiff() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; string password = null; string storage = null; string folder = null; string outPath = null; TiffExportOptions body = new TiffExportOptions(); body.ExportFormat = "tiff"; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.PostSlidesSaveAsTiff(name, password, storage, folder, outPath, body); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestPostSlidesPresentationReplaceText() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; string oldValue = "aspose"; string newValue = "aspose2"; bool? ignoreCase = null; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); PresentationStringReplaceResponse actual; actual = target.PostSlidesPresentationReplaceText(name, oldValue, newValue, ignoreCase, folder, storage); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.PresentationStringReplaceResponse(), actual.GetType()); }
public void TestGetShapeWithFormat() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; int? slideIndex = 1; int? shapeIndex = 1; string format = "png"; string folder = null; string storage = null; float? scaleX = null; float? scaleY = null; string bounds = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.GetShapeWithFormat(name, slideIndex, shapeIndex, format, folder, storage, scaleX, scaleY, bounds); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestPutSlidesDocumentFromHtml() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "slide_" + new Random().Next(100) + ".pptx"; string password = null; string storage = null; string folder = null; byte[] file = System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + "test.html"); ResponseMessage actual; actual = target.PutSlidesDocumentFromHtml(name, password, storage, folder, file); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestPutSlidesConvert() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string password = null; string format = "pdf"; string outPath = null; byte[] file = System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + "test_slide.pptx"); ResponseMessage actual; actual = target.PutSlidesConvert(password, format, outPath, file); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestPutSetParagraphPortionProperties() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; int? slideIndex = 1; int? shapeIndex = 1; int? paragraphIndex = 1; int? portionIndex = 1; string folder = null; string storage = null; Portion body = new Portion(); body.Text = "Newer Value"; body.FontColor = "#FFFF0000"; body.FontHeight = 5.0; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.PutSetParagraphPortionProperties(name, slideIndex, shapeIndex, paragraphIndex, portionIndex, folder, storage, body); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestPutPresentationMerge() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; string mergeFile1 = "welcome.pptx"; string mergeFile2 = "demo.pptx"; string storage = null; string folder = null; OrderedMergeRequest body = new OrderedMergeRequest(); PresentationToMerge ptm1 = new PresentationToMerge(); ptm1.Path = mergeFile1; PresentationToMerge ptm2 = new PresentationToMerge(); ptm2.Path = mergeFile2; body.Presentations = new System.Collections.Generic.List<PresentationToMerge> {ptm1, ptm2 }; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); DocumentResponse actual; actual = target.PutPresentationMerge(name, storage, folder, body); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.DocumentResponse(), actual.GetType()); }
public void TestPostSlidesSplit() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "sample-input.pptx"; int? width = null; int? height = null; int? to = 3; int? from = 2; string destFolder = null; string format = "png"; string storage = null; string folder = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); SplitDocumentResponse actual; actual = target.PostSlidesSplit(name, width, height, to, from, destFolder, format, storage, folder); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.SplitDocumentResponse(), actual.GetType()); }
public void TestPostSlidesSetDocumentProperties() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "sample-input.pptx"; string folder = null; string storage = null; DocumentProperties body = new DocumentProperties(); DocumentProperty docProperty = new DocumentProperty(); docProperty.Name = "Author"; docProperty.Value = "Imran Anwar"; body.List = new System.Collections.Generic.List<DocumentProperty> { docProperty}; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); DocumentPropertiesResponse actual; actual = target.PostSlidesSetDocumentProperties(name, folder, storage, body); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.DocumentPropertiesResponse(), actual.GetType()); }
public void TestPostPresentationMerge() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; string mergeFile1 = "sample-input.pptx"; string mergeFile2 = "demo.pptx"; string storage = null; string folder = null; PresentationsMergeRequest body = new PresentationsMergeRequest(); body.PresentationPaths = new System.Collections.Generic.List<string> {mergeFile1,mergeFile2}; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); storageApi.PutCreate(mergeFile1, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + mergeFile1)); storageApi.PutCreate(mergeFile2, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + mergeFile2)); DocumentResponse actual; actual = target.PostPresentationMerge(name, storage, folder, body); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.DocumentResponse(), actual.GetType()); }
public void TestPostSlidesDocument() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "slide_"+ new Random().Next(100) +".pptx"; string templatePath = "test_slide.pptx"; string templateStorage = null; bool? isImageDataEmbeeded = false; string password = null; string storage = null; string folder = null; byte[] file = System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + "test.html"); storageApi.PutCreate(templatePath, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + templatePath)); ResponseMessage actual; actual = target.PostSlidesDocument(name, templatePath, templateStorage, isImageDataEmbeeded, password, storage, folder, file); Assert.AreEqual("Created", actual.Status); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }
public void TestGetSlidesDocumentProperty() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; string propertyName = "Author"; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); DocumentPropertyResponse actual; actual = target.GetSlidesDocumentProperty(name, propertyName, folder, storage); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.DocumentPropertyResponse(), actual.GetType()); }
public void TestPostSlidesReorderPosition() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "sample-input.pptx"; int? oldPosition = 1; int? newPosition = 2; string folder = null; string storage = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); SlideListResponse actual; actual = target.PostSlidesReorderPosition(name, oldPosition, newPosition, folder, storage); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.SlideListResponse(), actual.GetType()); }
public void TestGetSlidesDocumentWithFormat() { SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "test_slide.pptx"; string format = "tiff"; string jpegQuality = null; string password = null; string storage = null; string folder = null; string outPath = null; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name)); ResponseMessage actual; actual = target.GetSlidesDocumentWithFormat(name, format, jpegQuality, password, storage, folder, outPath); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType()); }