日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

copyright symbol issue

系統(tǒng) 1948 0

下面這段代碼是調(diào)用java的Service獲取PDF的字節(jié)數(shù)組,但是在生成的報(bào)告中,商標(biāo)符號(hào)前面多了一個(gè)字符,后來為ContentType添加了charset=utf-8,就解決了這個(gè)問題。req.ContentType = "application/x-www-form-urlencoded; charset=utf-8";

byte[] result = null;

string url = ConfigurationManager.AppSettings["iTextJavaReportService"];

int timeout = 60000;

int.TryParse(ConfigurationManager.AppSettings["iTextJavaReportServiceTimeout"], out timeout);

string dataXml = reportData != null ? reportData.CreateNavigator().OuterXml : string.Empty;

try

{

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);

req.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;

req.ContentType = "application/x-www-form-urlencoded";

req.Method = "POST";

req.Timeout = timeout;

byte[] bytesparamName = System.Text.Encoding.UTF8.GetBytes("dataXml=");

byte[] bytes = System.Text.Encoding.UTF8.GetBytes(HttpUtility.UrlEncode(dataXml));

req.ContentLength = bytes.Length + bytesparamName.Length;

using (Stream requestStream = req.GetRequestStream())

{

requestStream.Write(bytesparamName, 0, bytesparamName.Length);

requestStream.Write(bytes, 0, bytes.Length);

}

using (WebResponse resp = (WebResponse)req.GetResponse())

{

using (BinaryReader br = newBinaryReader(resp.GetResponseStream()))

{

result = br.ReadBytes(1000000);

}

}

}

catch (Exception ex)

{

log.Error(string.Format("Error retrieving PDF Data.\n{0\n}", url), ex);

throw;

}

return result;

copyright symbol issue


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 阜南县| 道真| 新龙县| 威宁| 抚顺县| 酉阳| 怀安县| 贵定县| 长子县| 龙山县| 荥阳市| 南靖县| 沙湾县| 文成县| 宝应县| 仁布县| 桂平市| 凤台县| 莒南县| 宜兰县| 南宁市| 临西县| 内黄县| 宁晋县| 安陆市| 黄大仙区| 昌都县| 额尔古纳市| 轮台县| 莆田市| 华阴市| 迁安市| 泸州市| 隆子县| 皋兰县| 龙川县| 衡东县| 兰考县| 突泉县| 太仆寺旗| 多伦县|