public static void Run()
        {
            // ExStart:1
            PdfApi     pdfApi     = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName       = "segments.pdf";
            int    pageNumber     = 1;
            int    fragmentNumber = 1;
            int    segmentNumber  = 1;
            String storage        = "";
            String folder         = "";

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

                // Invoke Aspose.PDF Cloud SDK API to get text format of particular segment
                TextFormatResponse apiResponse = pdfApi.GetSegmentTextFormat(fileName, pageNumber, fragmentNumber, segmentNumber, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    TextFormat segTextFormat = apiResponse.TextFormat;
                    Console.WriteLine("Segment Font Name - " + segTextFormat.FontName);
                    Console.WriteLine("Segment Font Size - " + segTextFormat.FontSize.Value);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
 public void Pdf_FragmentsAndSegments_Tests()
 {
     try
     {
         TextItemsResponse  textItemsResponse   = pdfService.FragmentsAndSegments.ReadPageFragments("pdf-sample.pdf", 1, true, Utils.CloudStorage_Input_Folder);
         TextItemsResponse  textItemsResponse2  = pdfService.FragmentsAndSegments.ReadPageFragment("pdf-sample.pdf", 1, 1, true, Utils.CloudStorage_Input_Folder);
         TextFormatResponse textFormatResponse  = pdfService.FragmentsAndSegments.ReadPageFragmentTextFormat("pdf-sample.pdf", 1, 1, Utils.CloudStorage_Input_Folder);
         TextItemsResponse  textItemsResponse3  = pdfService.FragmentsAndSegments.ReadFragmentSegments("pdf-sample.pdf", 1, 1, true, Utils.CloudStorage_Input_Folder);
         TextItemResponse   textItemResponse    = pdfService.FragmentsAndSegments.ReadSegment("pdf-sample.pdf", 1, 1, 1, Utils.CloudStorage_Input_Folder);
         TextFormatResponse textFormatResponse2 = pdfService.FragmentsAndSegments.ReadSegmentTextFormat("pdf-sample.pdf", 1, 1, 1, Utils.CloudStorage_Input_Folder);
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }