public void TestGetPages(string filePath, PreviewOptions.FormatEnum?format = null, List <int?> pageNumbersToConvert = null,
                                 bool withoutAnnotations = false, int width       = 0, int height = 0,
                                 bool renderComments     = false, string password = null)
        {
            var fileInfo = new Model.FileInfo
            {
                FilePath = filePath,
                Password = password
            };
            var options = new PreviewOptions
            {
                FileInfo       = fileInfo,
                Format         = format,
                Height         = height,
                Width          = width,
                PageNumbers    = pageNumbersToConvert,
                RenderComments = renderComments
            };
            var request = new GetPagesRequest(options);
            var result  = PreviewApi.GetPages(request);

            Assert.NotNull(result);
            Assert.Greater(result.TotalCount, 0);
            Assert.NotNull(result.Entries);
            Assert.Greater(result.Entries.Count, 0);
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
            var apiInstance   = new PreviewApi(configuration);

            try
            {
                // Set request.
                var request = new GetPagesRequest()
                {
                    filePath            = "Annotationdocs\\ten-pages.docx",
                    password            = null,
                    pageNumber          = 1,
                    countPagesToConvert = 1,
                    enableCaching       = false,
                    cacheStoragePath    = null,
                    withoutAnnotations  = true
                };

                var response = apiInstance.GetPages(request);
                Console.WriteLine("Expected response type is PageImages: " + response.ToString());
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling Annotation PreviewApi: " + e.Message);
            }
        }
        public void TestDeletePages(string filePath)
        {
            var fileInfo = new Model.FileInfo
            {
                FilePath = filePath
            };

            PreviewApi.DeletePages(new DeletePagesRequest(fileInfo));
        }
        public void BeforeAllTests()
        {
            var config = new Configuration(_appSid, _appKey)
            {
                ApiBaseUrl = _apiBaseUrl
            };

            InfoApi     = new InfoApi(config);
            AnnotateApi = new AnnotateApi(config);
            PreviewApi  = new PreviewApi(config);
            FileApi     = new FileApi(config);
            FolderApi   = new FolderApi(config);
            StorageApi  = new StorageApi(config);

            UploadTestFiles();
        }
        public static void Run()
        {
            var apiInstance = new PreviewApi(Constants.GetConfig());

            try
            {
                var fileInfo = new FileInfo {
                    FilePath = "one-page.docx"
                };
                var request = new DeletePagesRequest(fileInfo);

                apiInstance.DeletePages(request);
                Console.WriteLine("DeletePages: pages deleted.");
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling Annotation PreviewApi: " + e.Message);
            }
        }
Ejemplo n.º 6
0
        public static void Run()
        {
            var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
            var apiInstance   = new PreviewApi(configuration);

            try
            {
                // Set request.
                var request = new DeletePagesRequest()
                {
                    filePath = "Annotationdocs\\one-page.docx"
                };

                apiInstance.DeletePages(request);
                Console.WriteLine("Expected response type is Void: pages deleted.");
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling Annotation PreviewApi: " + e.Message);
            }
        }
Ejemplo n.º 7
0
        public static void Run()
        {
            var apiInstance = new PreviewApi(Constants.GetConfig());

            try
            {
                var fileInfo = new FileInfo {
                    FilePath = "one-page.docx"
                };
                var options = new PreviewOptions {
                    FileInfo = fileInfo
                };

                var request = new GetPagesRequest(options);

                var response = apiInstance.GetPages(request);
                Console.WriteLine("GetPages: pages count = " + response.TotalCount);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling Annotation PreviewApi: " + e.Message);
            }
        }
Ejemplo n.º 8
0
 public void Init()
 {
     instance = new PreviewApi();
 }