示例#1
0
        public static void Main(String[] args){

            try
            {
                System.Diagnostics.Debug.WriteLine("\n\nFetching the results...");
                StorageApi storageApi = new StorageApi("xxx", "xxx", "http://api.aspose.com/v1.1");

                string fileName = "test_multi_pages.docx";

                System.Diagnostics.Debug.WriteLine(storageApi.PutCreate(fileName,null, null, System.IO.File.ReadAllBytes("\\temp\\"+fileName)));

                //storageApi.PutCreate(fileName, null, null, System.IO.File.ReadAllBytes("\\temp\\resources\\" + fileName));

                ////System.Diagnostics.Debug.WriteLine(storageApi.GetDownload(fileName, null, null)+"\n\nthese were the file contents");


                byte[] responseStream = storageApi.GetDownload(fileName, null, null).ResponseStream;
                System.IO.File.WriteAllBytes("\\temp\\new_" + fileName, responseStream);

                //System.Diagnostics.Debug.WriteLine(storageApi.GetListFiles("", ""));

                //System.IO.File.WriteAllBytes("\\temp\\new_" + fileName, System.IO.File.ReadAllBytes("\\temp\\"+fileName));

            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("\nError:"+ex.Message+"\n" + ex.StackTrace + "\n");
            }
        }
        public static void Run()
        {
            // ExStart:1

            // Instantiate Aspose Storage Cloud API SDK
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // Instantiate Aspose BarCode Cloud API SDK
            BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // set input file name
            String name = "sample-barcode.jpeg";

            //The barcode type.
            //If this parameter is empty, autodetection of all supported types is used.
            String type = "";

            // Set folder location at cloud storage
            String folder = "";
            
            BarcodeReader body = new BarcodeReader();

            // Set if FNC symbol stripping should be performed.
            body.StripFNC = true;

            // Set mode for checksum validation during recognition
            body.ChecksumValidation = "ON";

            // Set special mode of barcode binarization
            body.BinarizationHints = BinarizationHints.ComplexBackground;

            try
            {
                //upload source file to aspose cloud storage
                 BarcodeResponseList apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body);

                 // invoke Aspose.BarCode Cloud SDK API to recognition of a barcode from file on server with parameters in body
                 apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body);

                if (apiResponse != null)
                {
                    foreach (Barcode barcode in apiResponse.Barcodes)
                    {
                        Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType);
                    }
                    Console.WriteLine("Recognize Barcode with Checksum Option, Done!");

                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

            }
            // ExEnd:1
        }
        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 static void Run()
        {

            // ExStart:1
            // Instantiate Aspose Storage Cloud API SDK
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // Instantiate Aspose OCR Cloud API SDK
            OcrApi ocrApi = new OcrApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // Set the image file name 
            String name = "Sampleocr.bmp";

            // Set the language of the document.
            String language = "English";

            // Set X and Y coordinate to recognize text inside..
            int? rectX = 150;
            int? rectY = 100;

            //Set Width and Height to recognize text inside.
            int? rectWidth = 1000;
            int? rectHeight = 300;

            //Set the spelling correction is used.
            bool? useDefaultDictionaries = true;

            //Set 3rd party cloud storage server (if any)
            String storage = "";
            String folder = "";

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

                // invoke Aspose.OCR Cloud SDK API to extract text and partsinfo from an image           
                OCRResponse apiResponse = ocrApi.GetRecognizeDocument(name, language, rectX, rectY, rectWidth, rectHeight, useDefaultDictionaries, storage, folder); 
               
                if (apiResponse != null)
                {
                    Console.WriteLine("Codetext: " + apiResponse.Text+ "\n");

                    Console.WriteLine("Extract OCR or HOCR Text from a specific Block, Done!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
示例#5
0
        public void TestDeleteProperties()
        {
            PdfApi target = new PdfApi(APIKEY, APPSID, BASEPATH);
            StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

            string name = "Sample-Annotation.pdf";
            string storage = null;
            string folder = null;

            storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\pdf\\resources\\" + name));

            Com.Aspose.PDF.Model.SaaSposeResponse actual;
            actual = target.DeleteProperties(name, storage, folder);

            Assert.AreEqual("200", actual.Code);
            Assert.IsInstanceOfType(new Com.Aspose.PDF.Model.SaaSposeResponse(), actual.GetType());
        }
        public void TestDeleteCalendarException()
        {
            TasksApi target = new TasksApi(APIKEY, APPSID, BASEPATH);
            StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

            string name = "sample-project.mpp";
            int? calendarUid = 1;
            int? index = 1;
            string fileName = null;
            string storage = null;
            string folder = null;

            storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));
            SaaSposeResponse actual;
            actual = target.DeleteCalendarException(name, calendarUid, index, fileName, storage, folder);
            Assert.AreEqual("200", actual.Code);
            Assert.IsInstanceOfType(new SaaSposeResponse(), actual.GetType());
        }
        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 TestGetChangeImageScale()
        {
            ImagingApi target = new ImagingApi(APIKEY, APPSID, BASEPATH);
            StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);


            string name = "aspose_imaging_for_cloud.png";
            string format = "jpg";
            int? newWidth = 200;
            int? newHeight = 200;
            string outPath = "";
            string folder = "";
            string storage = "";

             storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\imaging\\resources\\" + name)); 

            ResponseMessage actual;
            actual = target.GetChangeImageScale(name, format, newWidth, newHeight, outPath, folder, storage);

            Assert.AreEqual(200, actual.Code);
            Assert.IsInstanceOfType(new ResponseMessage(), actual.GetType()); 
        }
        public void TestGetRecognizeDocument()
        {
            OcrApi target = new OcrApi(APIKEY, APPSID, BASEPATH);
            StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

            string name =  "Sampleocr.bmp";
            string language =  "english";
            int? rectX = null;
            int? rectY = null;
            int? rectWidth = null;
            int? rectHeight = null;
            bool?  useDefaultDictionaries = null;
            string storage =  null;
            string folder =  null;

            storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\ocr\\resources\\" + name));
            
            Com.Aspose.OCR.Model.OCRResponse actual;
            actual = target.GetRecognizeDocument(name, language, rectX, rectY, rectWidth, rectHeight, useDefaultDictionaries, storage, folder);
            
            Assert.AreEqual("200", actual.Code);
            Assert.IsInstanceOfType(new OCRResponse(), 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 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 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 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 static void Main(String[] args)
        {

string APIKEY = "xxxxx";
string APPSID = "xxxxx";
string BASEPATH = "http://api.aspose.com/v1.1";

///*
//*  Working with Tasks   
//*  Retrieve Task Information 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//int taskUid = 1;
//String storage = "";
//String folder = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    TaskResponse apiResponse = tasksApi.GetProjectTask(name, taskUid, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Task task = apiResponse.Task;
//        Console.WriteLine("Task Name " + task.Name);
//        Console.WriteLine("Start Date " + task.Start);
//        Console.WriteLine("Actual Duration " + task.ActualDuration);
//        Console.WriteLine("Retrieve Task Information, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}

///*
//*  Working with Tasks   
//*  Delete a Task from Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//int taskUid = 1;
//String storage = "";
//String folder = "";
//String fileName = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteProjectTask(name, taskUid, storage, folder, fileName);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete a Task from Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}

///*
//*  Working with Tasks   
//*  Add a Task to Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String taskName = "NewTask";
//int beforeTaskId = 1;
//String fileName = "";
//String storage = "";
//String folder = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    TaskItemResponse apiResponse = tasksApi.PostProjectTask(name, taskName, beforeTaskId, fileName, storage, folder);

//    if (apiResponse != null)
//    {
//        Console.WriteLine("Add a Task to Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}

///*
//*  Working with Resources    
//*  Delete Resource From Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//int resourceUid = 1;
//String storage = "";
//String folder = "";
//String fileName = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteProjectResource(name, resourceUid, storage, folder, fileName);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete Resource From Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}


///*
//*  Working with Resources    
//*  Add a Resource To Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String resourceName = "Resource6";
//int beforeResourceId = 1;
//String fileName = "";
//String storage = "";
//String folder = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    ResourceItemResponse apiResponse = tasksApi.PostProjectResource(name, resourceName, beforeResourceId, fileName, storage, folder);

//    if (apiResponse != null)
//    {
//        Console.WriteLine("Add a Resource To Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Resources    
//*  Retrieve Resource Information 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

////set input file name
//String name = "sample-project.mpp";
//int resourceUid = 1;
//String storage = "";
//String folder = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    ResourceResponse apiResponse = tasksApi.GetProjectResource(name, resourceUid, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Resource resource = apiResponse.Resource;
//        Console.WriteLine("Resource Id " + resource.Id);
//        Console.WriteLine("Resource Name  " + resource.Name);
//        Console.WriteLine("Retrieve Resource Information, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Calendars     
//*  Retrieve Calendars Information from a Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    CalendarItemsResponse apiResponse = tasksApi.GetProjectCalendars(name, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        foreach (CalendarItem calendarItem in apiResponse.Calendars.List)
//        {
//            Console.WriteLine("Calendar Name " + calendarItem.Name);
//            Console.WriteLine("Calendar Uid  " + calendarItem.Uid);
//        }
//        Console.WriteLine("Retrieve Calendars Information from a Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}




///*
//*  Working with Calendars     
//*  Add Calendar to Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String fileName = null;
//String storage = null;
//String folder = null;
//Calendar body = new Calendar();
//body.Uid = 0;
//body.Name = "TestCalender";
//body.IsBaseCalendar = true;
//body.IsBaselineCalendar = false;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    CalendarItemResponse apiResponse = tasksApi.PostProjectCalendar(name, fileName, storage, folder, body);


//    if (apiResponse != null)
//    {
//        Console.WriteLine("Add Calendar to Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}




///*
//*  Working with Calendars     
//*  Delete a Calendar from Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//int calendarUid = 2;
//String storage = null;
//String folder = null;
//String fileName = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteProjectCalendar(name, calendarUid, storage, folder, fileName);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete a Calendar from Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}




///*
//*  Working with Assignments      
//*  Retrieve Assignments Information from Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    AssignmentItemsResponse apiResponse = tasksApi.GetProjectAssignments(name, storage, folder);


//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        foreach (AssignmentItem assignmentItem in apiResponse.Assignments.AssignmentItem)
//        {
//            Console.WriteLine("Calendar Name " + assignmentItem.Uid);
//            Console.WriteLine("Calendar Uid  " + assignmentItem.TaskUid);
//            Console.WriteLine("Calendar Uid  " + assignmentItem.ResourceUid);
//        }
//        Console.WriteLine("Retrieve Assignments Information from Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Assignments      
//*  Add Assignment to Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//int taskUid = 1;
//int resourceUid = 1;
//Double units = 1.0;
//String fileName = "";
//String storage = "";
//String folder = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    AssignmentItemResponse apiResponse = tasksApi.PostProjectAssignment(name, taskUid, resourceUid, units, fileName, storage, folder);



//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Add Assignment to Project , Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}




///*
//*  Working with Assignments      
//*  Delete an Assignment from a Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project-2.mpp";
//int assignmentUid = 1;
//String storage = "";
//String folder = "";
//String fileName = "";


//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteProjectAssignment(name, assignmentUid, storage, folder, fileName);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete an Assignment from a Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}





///*
//*  Working with Links       
//*  Retrieve Task Links Information from a Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    TaskLinksResponse apiResponse = tasksApi.GetTaskLinks(name, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        foreach (TaskLink taskLink in apiResponse.TaskLinks)
//        {
//            Console.WriteLine("Task Link Index  " + taskLink.Index);
//            Console.WriteLine("PredecessorUid " + taskLink.PredecessorUid);
//            Console.WriteLine("SuccessorUid " + taskLink.SuccessorUid);
//        }
//        Console.WriteLine("Retrieve Task Links Information from a Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}




///*
//*  Working with Links       
//*  Add a Task Link to Project 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String storage = "";
//String folder = "";
//String fileName = "";

//TaskLink body = new TaskLink();
//body.Index = 2;
//body.PredecessorUid = 1;
//body.SuccessorUid = 2;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.PostTaskLink(name, storage, folder, fileName, body);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Add a Task Link to Project, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}




///*
//*  Working with Links       
//*  Delete a Task Link 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//int index = 1;
//String storage = "";
//String folder = "";
//String fileName = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteTaskLink(name, index, storage, folder, fileName);


//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete a Task Link, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Outline Codes and Extended Attributes        
//*  Retrieve Outline Codes Information 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project.mpp";
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    OutlineCodeItemsResponse apiResponse = tasksApi.GetOutlineCodes(name, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Retrieve Outline Codes Information, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}

///*
//*  Working with Outline Codes and Extended Attributes        
//*  Delete A Project Outline Code 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "Outlinecode.mpp";
//int index = 1;
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteOutlineCodeByIndex(name, index, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete A Project Outline Code, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Outline Codes and Extended Attributes        
//*  Retrieve Extended Attributes Information 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "ResourceWithExtAttribs.xml";
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    ExtendedAttributeItemsResponse apiResponse = tasksApi.GetExtendedAttributes(name, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Retrieve Extended Attributes Information , Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Outline Codes and Extended Attributes        
//*  Delete A Project Extended Attribute 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "ExtendedAttribute.mpp";
//int index = 1;
//String storage = null;
//String folder = null;

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    SaaSposeResponse apiResponse = tasksApi.DeleteExtendedAttributeByIndex(name, index, storage, folder);

//    if (apiResponse != null && apiResponse.Status.Equals("OK"))
//    {
//        Console.WriteLine("Delete A Project Extended Attribute , Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



///*
//*  Working with Project Documents       
//*  Convert Project Data to Other Formats 
//*/

//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

//String name = "sample-project";
//String fileName = name + ".mpp";
//String format = "pdf";
//String storage = "";
//String folder = "";

//try
//{
//    //upload source file to aspose cloud storage
//    storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + fileName));

//    //invoke Aspose.PDF Cloud SDK API to append word document
//    ResponseMessage apiResponse = tasksApi.GetTaskDocumentWithFormat(fileName, format, storage, folder);

//    if (apiResponse != null)
//    {
//        //download appended document from storage server
//        System.IO.File.WriteAllBytes("\\temp\\" + name + "." + format, apiResponse.ResponseStream);
//        Console.WriteLine("Retrieve Outline Codes Information, Done!");
//        Console.ReadKey();
//    }
//}
//catch (Exception ex)
//{
//    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

//}



/*
*  Working with Outline Codes and Extended Attributes        
*  Retrieve Project Properties 
*/

TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

String name = "sample-project.mpp";
String storage = null;
String folder = null;

try
{
    //upload source file to aspose cloud storage
    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

    //invoke Aspose.PDF Cloud SDK API to append word document
    DocumentPropertiesResponse apiResponse = tasksApi.GetDocumentProperties(name, storage, folder);

    if (apiResponse != null && apiResponse.Status.Equals("OK"))
    {
        foreach (DocumentProperty docProp in apiResponse.Properties.List)
        {
            Console.WriteLine(docProp.Name + " :: " + docProp.Value);
        }
        Console.WriteLine("Retrieve Project Properties, Done!");
        Console.ReadKey();
    }
}
catch (Exception ex)
{
    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

}



            ///*
            //*  Working with Outline Codes and Extended Attributes        
            //*  Retrieve Outline Codes Information 
            //*/

            //TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
            //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

            //String name = "sample-project.mpp";
            //String storage = null;
            //String folder = null;

            //try
            //{
            //    //upload source file to aspose cloud storage
            //    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

            //    //invoke Aspose.PDF Cloud SDK API to append word document
            //    OutlineCodeItemsResponse apiResponse = tasksApi.GetOutlineCodes(name, storage, folder);

            //    if (apiResponse != null && apiResponse.Status.Equals("OK"))
            //    {
            //        Console.WriteLine("Retrieve Outline Codes Information, Done!");
            //        Console.ReadKey();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

            //}



            ///*
            //*  Working with Outline Codes and Extended Attributes        
            //*  Retrieve Outline Codes Information 
            //*/

            //TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
            //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

            //String name = "sample-project.mpp";
            //String storage = null;
            //String folder = null;

            //try
            //{
            //    //upload source file to aspose cloud storage
            //    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

            //    //invoke Aspose.PDF Cloud SDK API to append word document
            //    OutlineCodeItemsResponse apiResponse = tasksApi.GetOutlineCodes(name, storage, folder);

            //    if (apiResponse != null && apiResponse.Status.Equals("OK"))
            //    {
            //        Console.WriteLine("Retrieve Outline Codes Information, Done!");
            //        Console.ReadKey();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

            //}



            ///*
            //*  Working with Outline Codes and Extended Attributes        
            //*  Retrieve Outline Codes Information 
            //*/

            //TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
            //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);

            //String name = "sample-project.mpp";
            //String storage = null;
            //String folder = null;

            //try
            //{
            //    //upload source file to aspose cloud storage
            //    storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));

            //    //invoke Aspose.PDF Cloud SDK API to append word document
            //    OutlineCodeItemsResponse apiResponse = tasksApi.GetOutlineCodes(name, storage, folder);

            //    if (apiResponse != null && apiResponse.Status.Equals("OK"))
            //    {
            //        Console.WriteLine("Retrieve Outline Codes Information, Done!");
            //        Console.ReadKey();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

            //}





//
// End...
//
        }
 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 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 static void Run()
        {
            // ExStart:1
            
            // Instantiate Aspose Storage Cloud API SDK
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // Instantiate Aspose BarCode Cloud API SDK
            BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // set input file name
            String name = "sample-barcode.jpeg";

            //The barcode type.
            //If this parameter is empty, autodetection of all supported types is used.
            String type = "";

            //Sets mode for checksum validation during recognition
            String checksumValidation = "";

            //Sets if FNC symbol stripping should be performed. 
            bool stripFnc = true;

            //Sets recognition of rotated barcode
            int? rotationAngle = null;

            //Sets exact number of barcodes to recognize 
            int? barcodesCount = null;

            //Set recognition of barcode inside specified Rectangle region
            int? rectX = 10;
            int? rectY = 10;
            int? rectWidth = 200;
            int? rectHeight = 200;
            
            //Set 3rd party cloud storage server (if any)
            String storage = "";

            // Set folder location at cloud storage
            String folder = "";

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

                // invoke Aspose.BarCode Cloud SDK API to read barcode with specific region of image
                BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder);


                if (apiResponse != null)
                {
                    foreach (Barcode barcode in apiResponse.Barcodes)
                    {
                        Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType);
                    }
                    Console.WriteLine("Read Barcode from Specific Region of Image, Done!");
                    
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);

            }
            // ExEnd:1
        }
        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 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 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 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 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 static void Run()
        {

            // ExStart:1
            // Instantiate Aspose Storage Cloud API SDK
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // Instantiate Aspose BarCode Cloud API SDK
            BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            // Set the barcode file name created on server.
            String name = "sample-barcode";

            // Set Text to encode inside barcode.
            String text = "AsposeBarCode";

            // Set Barcode Symbology
            String type = "Code128";

            // Set Generated Barcode Image Format
            String format = "png";

            // Set Resolution along X and Y in dpi.
            float? resolutionX = null;
            float? resolutionY = null;

            //Set Width and Height of barcode unit
            float? dimensionX = null;
            float? dimensionY = null;

            //Set Location, Measurement  of the code
            String codeLocation = "Below";
            String grUnit = "mm";

            // Sets if barcode's size will be updated automatically
            String autoSize = "true";

            // Height of the bar.
            float? barHeight = null;

            //Set height, Width and quality of the image.
            float? imageHeight = null;
            float? imageWidth = null;
            String imageQuality = "default";

            // Set Angle of barcode orientation
            float? rotAngle = null;

            // Set Margin of image border
            float? topMargin = null;
            float? bottomMargin = null;
            float? leftMargin = null;
            float? rightMargin = null;

            // Sets if checksum will be added to barcode image.
            String enableChecksum = "";

            //Set 3rd party cloud storage server (if any)
            String storage = "";
            String folder = "";

            // Set local file (if any)
            byte[] file = null;

            try
            {
                // invoke Aspose.BarCode Cloud SDK API to generate barcode with appropriate code text location and put in cloud storage
                SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file);
                if (apiResponse != null)
                {
                    // download generated barcode from cloud storage
                    Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name, null, null);

                    //Save response stream to a file 
                    System.IO.File.WriteAllBytes(Common.OUTFOLDER + name + "." + format, storageRes.ResponseStream);
                    Console.WriteLine("Generate Barcode with Appropriate Code Text Location, Done!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
 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()); 
 }
 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 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()); 
        }