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); }
/// <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("&", "&") .Replace("/?", "?"); var postBody = SerializationHelper.Serialize(request.options); // http body (model) parameter return(this.apiInvoker.InvokeBinaryApi( resourcePath, "PUT", postBody, null, null)); }