Export to EPS file corrupted with Unicode data

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
stratadat
Newbie
Newbie
Posts: 13
Joined: Mon Feb 13, 2006 12:00 am

Export to EPS file corrupted with Unicode data

Post by stratadat » Tue Jul 11, 2006 6:33 am

I have TeeChart .NET Build 2.0.2306.26232 and I'm attempting to export to an EPS file. However, the exported file looks like it's corrupted. Upon further inspection, it appears that the data section of the EPS file is in Unicode UTF-16 format. However, it probably should just be regular ASCII (or maybe UTF-8 w/o the BOM is ok? Not sure on what standards apply here). I'm using GhostScript (GhostView) to open the file.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 11, 2006 8:21 am

Hi stratadat ,

This is a known issue (TF02011180) already listed on our defect list to be fixed for future releases. In the meantime you can use the workaround one customer suggested:

Code: Select all

string filename = "OKEPS.EPS";
 Memory Stream ms = new MemoryStream();
 tChart1.Export.Image.EPS.Save(ms);
 ms.Seek(0, SeekOrigin.Begin);
 FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite);
 while(true) {
 int x = ms.ReadByte();
 if (x < 0) break;
 if (x == 0x00 || x == 0xFF || x == 0xFE) continue; // <-- this is the point. I remove the char - 0x00, 0xFF, 0xFE
 fs.WriteByte(Convert.ToByte(x));
 }
 fs.Close();
 ms.Close();
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply