Example #1
0
        /// <summary>
        ///  SaveAs Tiff by passing settings
        /// </summary>
        /// <returns></returns>
        /***********Method  ProtectWorksheet Added by:Zeeshan*******/
        public bool SaveAsTiff(SaveAsTiffOptions image, string folderName)
        {
            try
            {
                string strJSON = JsonConvert.SerializeObject(image);
                //build URI to get page coun
                string strURI    = Product.BaseProductUri + "/pdf/" + FileName + "/SaveAs/tiff?folder=" + folderName;
                string signedURI = Utils.Sign(strURI);


                StreamReader reader = new StreamReader(Utils.ProcessCommand(signedURI, "PUT", strJSON));

                //further process JSON response
                strJSON = reader.ReadToEnd();

                //Parse the json string to JObject
                JObject parsedJSON = JObject.Parse(strJSON);

                BaseResponse stream = JsonConvert.DeserializeObject <BaseResponse>(parsedJSON.ToString());

                if (stream.Code == "200" && stream.Status == "OK")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        /// <summary>
        ///  SaveAs Tiff by passing settings
        /// </summary>
        /// <returns></returns>
        /***********Method  ProtectWorksheet Added by:Zeeshan*******/
        public bool SaveAsTiff(SaveAsTiffOptions image, string folderName)
        {

            try
            {


                string strJSON = JsonConvert.SerializeObject(image);
                //build URI to get page coun
                string strURI = Product.BaseProductUri + "/pdf/" + FileName + "/SaveAs/tiff?folder=" + folderName;
                string signedURI = Utils.Sign(strURI);


                StreamReader reader = new StreamReader(Utils.ProcessCommand(signedURI, "PUT", strJSON));

                //further process JSON response
                strJSON = reader.ReadToEnd();

                //Parse the json string to JObject
                JObject parsedJSON = JObject.Parse(strJSON);

                BaseResponse stream = JsonConvert.DeserializeObject<BaseResponse>(parsedJSON.ToString());

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

            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

        }