Exemple #1
0
        /***********Method  ProtectWorksheet Added by:Zeeshan*******/
        public bool SaveAsTiff(string resultFile, SaveAsTiffOptions saveAsTiffOptions, string folder)
        {
            try
            {
                //build URI to get Image
                string strURI = Product.BaseProductUri + "/words/" + FileName + "/SaveAs/tiff?";

                strURI += "resultFile=" + resultFile + "&useAntiAliasing=" + (saveAsTiffOptions.UseAntiAliasing ? "True" : "False") + "&useHighQualityRendering=" + (saveAsTiffOptions.UseHighQualityRendering ? "True" : "False") +
                          "&pageCount=" + saveAsTiffOptions.PageCount.ToString() + "&pageIndex=" + saveAsTiffOptions.PageIndex.ToString() + "&resolution=" + saveAsTiffOptions.Resolution + "&tiffCompression=" + saveAsTiffOptions.TiffCompression + "&folder=" + folder;

                string signedURI = Utils.Sign(strURI);

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

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

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

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

                if (baseResponse.Code == "200" && baseResponse.Status == "OK")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        /***********Method  ProtectWorksheet Added by:Zeeshan*******/
        public bool SaveAsTiff(string resultFile, SaveAsTiffOptions saveAsTiffOptions, string folder)
        {
            try
            {
                //build URI to get Image
                string strURI = Product.BaseProductUri + "/words/" + FileName + "/SaveAs/tiff?";

                strURI += "resultFile=" + resultFile + "&useAntiAliasing=" + (saveAsTiffOptions.UseAntiAliasing ? "True" : "False") + "&useHighQualityRendering=" + (saveAsTiffOptions.UseHighQualityRendering ? "True" : "False") +
                    "&pageCount=" + saveAsTiffOptions.PageCount.ToString() + "&pageIndex=" + saveAsTiffOptions.PageIndex.ToString() + "&resolution=" + saveAsTiffOptions.Resolution + "&tiffCompression=" + saveAsTiffOptions.TiffCompression + "&folder=" + folder;

                string signedURI = Utils.Sign(strURI);

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

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

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

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

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

            }
            catch (Exception ex)
            {
                return false;
            }
        }