Example #1
0
        public static void Run()
        {
            // ExStart:1
            SlidesApi  slidesApi  = new SlidesApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName         = "sample-input.pptx";
            int    slideIndex       = 1;
            int    placeholderIndex = 0;
            String folder           = "";
            String storage          = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Slides Cloud SDK API to get placeholder from a slide
                PlaceholderResponse apiResponse = slidesApi.GetSlidesPlaceholder(fileName, slideIndex, placeholderIndex, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Placeholder placeholder = apiResponse.Placeholder;
                    Console.WriteLine("Get Placeholder from a PowerPoint Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
 public void Slides_Placeholder_Tests()
 {
     try
     {
         PlaceholdersResponse placeholdersResponse = slidesService.Placeholders.ReadSlidePlaceholdersInfo("slide-sample.pptx", 1, Utils.CloudStorage_Input_Folder);
         PlaceholderResponse  placeholderResponse  = slidesService.Placeholders.ReadSlidePlaceholderInfo("slide-sample.pptx", 1, 1, Utils.CloudStorage_Input_Folder);
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
        public void getSlidesPlaceholderExample()
        {
            PlaceholderResponse response = null;

            try
            {
                GetSlidesPlaceholderRequest request = createGetSlidesPlaceholderRequest();
                response = api.GetSlidesPlaceholder(request);
                Console.WriteLine(response);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public void GetSlidesPlaceholderInvalidName()
        {
            InvalidPropertyTestExecutor <GetSlidesPlaceholderRequest, PlaceholderResponse> testExecutor =
                new InvalidPropertyTestExecutor <GetSlidesPlaceholderRequest, PlaceholderResponse>("GetSlidesPlaceholder", "Name");
            GetSlidesPlaceholderRequest request  = testExecutor.PrepareRequest();
            PlaceholderResponse         response = null;
            bool needAssertResponse = false;

            try
            {
                response           = m_instance.GetSlidesPlaceholder(request);
                needAssertResponse = true;
            }
            catch (Exception ex)
            {
                testExecutor.AssertException(ex);
            }
            if (needAssertResponse)
            {
                testExecutor.AssertResult(response);
            }
        }