Пример #1
0
        /// <summary>
        /// Add Stamp to the page
        /// </summary>
        /// <returns>Stamp</returns>
        ///

        /***********Method  AddStampWithTextState Added by:Zeeshan*******/
        public bool AddStampWithTextState(StampRequest stampRequest)
        {
            try
            {
                string strURI    = Product.BaseProductUri + "/pdf/" + FileName + "/pages/" + stampRequest.PageIndex + "/stamp/";
                string signedURI = Utils.Sign(strURI);


                string strJSON = JsonConvert.SerializeObject(stampRequest);

                Stream responseStream = Utils.ProcessCommand(signedURI, "PUT", strJSON);

                StreamReader reader      = new StreamReader(responseStream);
                string       strResponse = reader.ReadToEnd();

                //Parse the json string to JObject
                JObject pJSON = JObject.Parse(strResponse);

                StampResponse baseResponse = JsonConvert.DeserializeObject <StampResponse>(pJSON.ToString());

                if (baseResponse.Code == "200" && baseResponse.Status == "OK")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        /// <summary>
        /// Add Stamp to the page
        /// </summary>
        /// <returns>Stamp</returns>
        /// 

        /***********Method  AddStampWithTextState Added by:Zeeshan*******/
        public bool AddStampWithTextState(StampRequest stampRequest)
        {
            try
            {
                string strURI = Product.BaseProductUri + "/pdf/" + FileName + "/pages/" + stampRequest.PageIndex + "/stamp/";
                string signedURI = Utils.Sign(strURI);


                string strJSON = JsonConvert.SerializeObject(stampRequest);

                Stream responseStream = Utils.ProcessCommand(signedURI, "PUT", strJSON);

                StreamReader reader = new StreamReader(responseStream);
                string strResponse = reader.ReadToEnd();

                //Parse the json string to JObject
                JObject pJSON = JObject.Parse(strResponse);

                StampResponse baseResponse = JsonConvert.DeserializeObject<StampResponse>(pJSON.ToString());

                if (baseResponse.Code == "200" && baseResponse.Status == "OK")
                    return true;
                else
                    return false;

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }