Charset Export chart to PDFFormat wrong german spelt .NET
Posted: Mon Sep 10, 2007 9:09 am
Hi All,
Please help me!
I have a problem when exporting my chart to a PDF file.
Any text that contains special characters like öäüÖÄÜ, this are coming in the PDF file incorrect, although in the screen it's ok.
I have tried setting up the Charset to different type without success.
Is there any place else where can I set the Charset ?
Am I doing something wrong?
This is the code I am using:
protected void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
GetEvaluationRating();
Steema.TeeChart.Export.PDFFormat pdfPage = new Steema.TeeChart.Export.PDFFormat(WebChart1.Chart);
MemoryStream mem = new MemoryStream();
pdfPage.Save(mem);
byte[] bytes = mem.GetBuffer();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Clear();
// HttpContext.Current.Response.Charset = "ISO-8859-1";
// HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.Charset = System.Text.UTF8Encoding.UTF8.WebName;
HttpContext.Current.Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename=FsPe_Chart_{0}.{1}","007", "pdf") );
HttpContext.Current.Response.BinaryWrite(bytes);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
Please help me!
I have a problem when exporting my chart to a PDF file.
Any text that contains special characters like öäüÖÄÜ, this are coming in the PDF file incorrect, although in the screen it's ok.
I have tried setting up the Charset to different type without success.
Is there any place else where can I set the Charset ?
Am I doing something wrong?
This is the code I am using:
protected void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
GetEvaluationRating();
Steema.TeeChart.Export.PDFFormat pdfPage = new Steema.TeeChart.Export.PDFFormat(WebChart1.Chart);
MemoryStream mem = new MemoryStream();
pdfPage.Save(mem);
byte[] bytes = mem.GetBuffer();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Clear();
// HttpContext.Current.Response.Charset = "ISO-8859-1";
// HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.Charset = System.Text.UTF8Encoding.UTF8.WebName;
HttpContext.Current.Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename=FsPe_Chart_{0}.{1}","007", "pdf") );
HttpContext.Current.Response.BinaryWrite(bytes);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}