Export to EPS file corrupted with Unicode data
Export to EPS file corrupted with Unicode data
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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:
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 |
Instructions - How to post in this forum |