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;
            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 extract shapes
                ResponseMessage apiResponse = slidesApi.GetSlidesSlideShapes(fileName, slideIndex, folder, storage);

                if (apiResponse != null)
                {
                    Console.WriteLine("Extract Shapes from a Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #2
0
        public static void Run()
        {
            // ExStart:1
            SlidesApi slidesApi = new SlidesApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String name     = "sample";
            String fileName = name + ".pptx";
            String password = "";
            String format   = "pdf";
            String outPath  = "";

            byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName);

            try
            {
                // Invoke Aspose.Slides Cloud SDK API to convert document to other format using storage
                ResponseMessage apiResponse = slidesApi.PutSlidesConvert(password, format, outPath, file);

                if (apiResponse != null)
                {
                    // Download appended document from storage server
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + name + "." + format, apiResponse.ResponseStream);
                    Console.WriteLine("Convert PowerPoint Documents to other File Formats without Using Storage, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #3
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 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 = 3;
            String folder     = "";
            String storage    = "dropboxstorage";

            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 number of images in a slide using third party storage
                ImagesResponse apiResponse = slidesApi.GetSlidesSlideImages(fileName, slideIndex, folder, storage);

                if (apiResponse != null)
                {
                    int count = apiResponse.Images.List.Count;
                    Console.WriteLine("Total Images Found In Slide[3] :: " + count);
                    Console.WriteLine("Get Number of Images in a Slide Using Third Party Storage, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #5
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_empty_" + new Random().Next(100) + ".pptx";
            String password = "";
            String storage  = "";
            String folder   = "";

            byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "sample.pptx");

            try
            {
                // Invoke Aspose.Slides Cloud SDK API to create empty presentation
                ResponseMessage apiResponse = slidesApi.PutNewPresentation(fileName, password, storage, folder, file);

                if (apiResponse != null)
                {
                    // Download document from storage server
                    Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
                    System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream);
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + fileName, storageRes.ResponseStream);
                    Console.WriteLine("Create Empty PowerPoint Presentation, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #6
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";
            String folder   = "";
            String storage  = "dropboxstorage";

            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 detect all slides using third party storage
                SlideListResponse apiResponse = slidesApi.DeleteSlidesCleanSlidesList(fileName, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
                    System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream);
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + fileName, storageRes.ResponseStream);
                    Console.WriteLine("Delete All Slides from a Presentation Using Third Party Storage, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #7
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    oldPosition = 3;
            int    newPosition = 2;
            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 change position of slide in presentation
                SlideListResponse apiResponse = slidesApi.PostSlidesReorderPosition(fileName, oldPosition, newPosition, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
                    System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream);
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + fileName, storageRes.ResponseStream);
                    Console.WriteLine("Change Position of Slides in a PowerPoint Presentation, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        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";
            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 remove all document properties
                DocumentPropertiesResponse apiResponse = slidesApi.DeleteSlidesDocumentProperties(fileName, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Remove All Properties, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #9
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   = "demo.pptx";
            int    slideIndex = 1;
            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 slide background
                SlideBackgroundResponse apiResponse = slidesApi.GetSlidesSlideBackground(fileName, slideIndex, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    SlideBackground slideBackground = apiResponse.Background;
                    Console.WriteLine("SlideBackground Type :: " + slideBackground.Type);
                    Console.WriteLine("Get Background of a PowerPoint Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        private static bool IsTestDataUpToDate()
        {
            Stream version = SlidesApi.DownloadFile($"{c_tempTestFolder}/{c_versionFile}");

            if (version != null)
            {
                int actualVersion = 0;
                return(int.TryParse(new StreamReader(version).ReadToEnd(), out actualVersion) && actualVersion == c_expectedVersion);
            }
            return(false);
        }
Beispiel #11
0
        public static void Main(String[] args)
        {
            string APIKEY   = "xxxxx";
            string APPSID   = "xxxxx";
            string BASEPATH = "http://api.aspose.cloud/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);
            }
        }
Beispiel #12
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.pptx";
            String storage  = "";
            String folder   = "";

            String mergeFile1 = "test_slide.pptx";
            String mergeFile2 = "demo.pptx";

            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
            };

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

                // Invoke Aspose.Slides Cloud SDK API to merge selected slides
                DocumentResponse apiResponse = slidesApi.PutPresentationMerge(fileName, storage, folder, body);

                if (apiResponse != null)
                {
                    // Download document from storage server
                    Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
                    System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream);
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + fileName, storageRes.ResponseStream);
                    Console.WriteLine("Merge Selected Slides of PowerPoint Presentations, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
 public static void Init()
 {
     if (!s_initialized)
     {
         if (!IsTestDataUpToDate())
         {
             foreach (string file in Directory.EnumerateFiles(TestDataPath))
             {
                 string filePath = $"{c_tempTestFolder}/{Path.GetFileName(file)}";
                 SlidesApi.UploadFile(filePath, File.OpenRead(file));
             }
             Stream versionFile = new MemoryStream(Encoding.UTF8.GetBytes(c_expectedVersion.ToString()));
             SlidesApi.UploadFile($"{c_tempTestFolder}/{c_versionFile}", versionFile);
         }
         s_initialized = true;
     }
 }
Beispiel #14
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?   width      = null;
            int?   height     = null;
            int?   from       = 2;
            int?   to         = 3;
            String destFolder = "";
            String format     = "png";
            String storage    = "";
            String folder     = "";

            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 split powerpoint presentations
                SplitDocumentResponse apiResponse = slidesApi.PostSlidesSplit(fileName, width, height, to, from, destFolder, format, storage, folder);

                if (apiResponse != null)
                {
                    foreach (ResourceUri slideUri in apiResponse.SplitResult.Slides)
                    {
                        System.Diagnostics.Debug.WriteLine("SlideHref:" + slideUri.Href.Substring(slideUri.Href.LastIndexOf('/') + 1, (slideUri.Href.Length - slideUri.Href.LastIndexOf('/')) - 1));
                        String slidName = slideUri.Href.Substring(slideUri.Href.LastIndexOf('/') + 1, (slideUri.Href.Length - slideUri.Href.LastIndexOf('/')) - 1);
                        // Download document from storage server
                        Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(slidName, null, null);
                        System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream);
                        System.IO.File.WriteAllBytes(Common.GetDataDir() + slidName, storageRes.ResponseStream);
                    }
                    Console.WriteLine("Split PowerPoint Presentations, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        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   = "demo.pptx";
            int    slideIndex = 1;
            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 slide font scheme
                FontSchemeResponse apiResponse = slidesApi.GetSlidesThemeFontScheme(fileName, slideIndex, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    FontScheme fontScheme = apiResponse.FontScheme;
                    Console.WriteLine("Name: " + fontScheme.Name);
                    Console.WriteLine("ComplexScript (heading part) : " + fontScheme.Major.ComplexScript);
                    Console.WriteLine("EastAsian (heading part) : " + fontScheme.Major.EastAsian);
                    Console.WriteLine("Latin (heading part) : " + fontScheme.Major.Latin);
                    Console.WriteLine("ComplexScript (body part) : " + fontScheme.Minor.ComplexScript);
                    Console.WriteLine("EastAsian (body part) : " + fontScheme.Minor.EastAsian);
                    Console.WriteLine("Latin (body part) : " + fontScheme.Minor.Latin);
                    Console.WriteLine("Get Font Scheme of a PowerPoint Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        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;
            String oldValue   = "aspose";
            String newValue   = "apose2";
            bool   ignoreCase = true;
            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 replace all text instances in a slide
                SlideStringReplaceResponse apiResponse = slidesApi.PostSlidesSlideReplaceText(fileName, slideIndex, oldValue, newValue, ignoreCase, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    // Download updated presentation from cloud storage
                    Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
                    System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream);
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + fileName, storageRes.ResponseStream);
                    Console.WriteLine("Replace All Text Instances in a Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        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";
            String           propertyName = "Author";
            String           folder       = "";
            String           storage      = "";
            DocumentProperty body         = new DocumentProperty();

            body.Name    = "Author";
            body.Value   = "Naeem Akram";
            body.BuiltIn = true;

            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 set document property
                DocumentPropertyResponse apiResponse = slidesApi.PutSlidesSetDocumentProperty(fileName, propertyName, folder, storage, body);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    DocumentProperty docProperty = apiResponse.DocumentProperty;
                    Console.WriteLine(docProperty.Name + " :: " + docProperty.Value);
                    Console.WriteLine("Set Document Properties, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #18
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;
            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 comments of a slide
                SlideCommentsResponse apiResponse = slidesApi.GetSlidesSlideComments(fileName, slideIndex, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    SlideComments slideComments = apiResponse.SlideComments;

                    foreach (SlideComment slideComment in slideComments.List)
                    {
                        Console.WriteLine("Author :: " + slideComment.Author);
                        Console.WriteLine("Text :: " + slideComment.Text);
                    }
                    Console.WriteLine("Get Comments of a PowerPoint Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #19
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   = "demo.pptx";
            int    slideIndex = 1;
            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 slide color scheme
                ColorSchemeResponse apiResponse = slidesApi.GetSlidesThemeColorScheme(fileName, slideIndex, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    ColorScheme colorScheme = apiResponse.ColorScheme;
                    Console.WriteLine("Accent1 : " + colorScheme.Accent1);
                    Console.WriteLine("Accent3 : " + colorScheme.Accent2);
                    Console.WriteLine("Dark1 : " + colorScheme.Dark1);
                    Console.WriteLine("Dark2 : " + colorScheme.Dark2);
                    Console.WriteLine("Light1 : " + colorScheme.Light1);
                    Console.WriteLine("Get Color Scheme of a PowerPoint Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #20
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;
            Boolean withEmpty  = false;
            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 append word document
                TextItemsResponse apiResponse = slidesApi.GetSlidesSlideTextItems(fileName, slideIndex, withEmpty, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    foreach (TextItem textItem in apiResponse.TextItems.Items)
                    {
                        Console.WriteLine("Text :: " + textItem.Text);
                    }
                    Console.WriteLine("Get All Text Items from a Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #21
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 name        = "sample";
            String fileName    = name + ".pptx";
            String format      = "tiff";
            String jpegQuality = null;
            String password    = "";
            String storage     = "";
            String folder      = "";
            String outPath     = "";

            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 convert document to other format
                ResponseMessage apiResponse = slidesApi.GetSlidesDocumentWithFormat(fileName, format, jpegQuality, password, storage, folder, outPath);

                if (apiResponse != null)
                {
                    // Download appended document from storage server
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + name + "." + format, apiResponse.ResponseStream);
                    Console.WriteLine("Convert PowerPoint Documents to other File Formats, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Beispiel #22
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 name       = "sample-input";
            String fileName   = name + ".pptx";
            int    slideIndex = 3;
            String format     = "jpeg";
            int?   width      = null;
            int?   height     = null;
            String folder     = "";
            String storage    = "dropboxstorage";

            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 save slide as image with default size using third party storage
                ResponseMessage apiResponse = slidesApi.GetSlideWithFormat(fileName, slideIndex, format, width, height, folder, storage);

                if (apiResponse != null)
                {
                    System.IO.File.WriteAllBytes(Common.GetDataDir() + name + "." + format, apiResponse.ResponseStream);
                    Console.WriteLine("Save a Particular Slide as Image with Default Size Using Third Party Storage, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
 public static void DeleteFile(string storagePath)
 {
     SlidesApi.DeleteFile(storagePath);
 }
 public static void Upload(string localPath, string storagePath)
 {
     SlidesApi.CopyFile($"{c_tempTestFolder}/{localPath}", storagePath);
 }