Esempio n. 1
0
        public void TestAddDirect(string filePath, string annotationTypes = null, bool annotatedPages = false, int firstPage = -1, int lastPage = -1, string password = null)
        {
            var fileInfo = new Model.FileInfo
            {
                FilePath = filePath,
                Password = password
            };
            var options = new AnnotateOptions
            {
                FileInfo           = fileInfo,
                Annotations        = GetAnnotations(),
                FirstPage          = firstPage,
                LastPage           = lastPage,
                OnlyAnnotatedPages = annotatedPages
            };
            var request = new AnnotateDirectRequest(options);
            var result  = AnnotateApi.AnnotateDirect(request);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf(typeof(Stream), result);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds annotations to document and returns output file
        /// </summary>
        /// <param name="request">Request. <see cref="AnnotateDirectRequest" /></param>
        /// <returns><see cref="System.IO.Stream"/></returns>
        public System.IO.Stream AnnotateDirect(AnnotateDirectRequest request)
        {
            // verify the required parameter 'options' is set
            if (request.options == null)
            {
                throw new ApiException(400, "Missing required parameter 'options' when calling AnnotateDirect");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/annotation/add";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            var postBody = SerializationHelper.Serialize(request.options); // http body (model) parameter

            return(this.apiInvoker.InvokeBinaryApi(
                       resourcePath,
                       "PUT",
                       postBody,
                       null,
                       null));
        }