Skip to main content
Participant
August 27, 2025
Question

Unable to Extract Readable Text from .EPS File Using Python and Ghostscript

  • August 27, 2025
  • 1 reply
  • 337 views

Goal: I want to translate the text within an .eps file.

To achieve this, I am using Python along with Ghostscript to extract text from the .eps file. However, instead of readable text, I am getting garbage or encoded values (e.g., 

㻨㻯㼍㼞㼞㼕㼑㼞㻌㼠㼞㼡㼏㼗㻪,
㻨㼀㼛㼣㼕㼚㼓㻌㼠㼞㼡㼏㼗㻌㻔㼍㼘㼘㻌㼣㼔㼑㼑㼘㼟㻌㼘㼕㼒㼠㼑㼐㻕㻪,
㻟㻜㻠㻡㻤㻢㻱

).

How can I extract the actual text from the .eps file so that I can translate it and then reinsert the translated text back into the same positions in the .eps file to produce a translated version?

I have also attached the source .eps file for reference.


 

 

1 reply

Legend
August 27, 2025

Generally, I would not recommend directly editing the files. For EPS files created in Illustrator, it's best to use a script within the Illustrator application to find the text frames and translate them.

 

If that technical approach—using Python and Ghostscript—is to succeed, you would probably need to downgrade the EPS file to Illustrator version 10 or 8 equivalent.

 

As far as I recall, up to these versions, the text should have been editable as plain text. Not sure if Ghostscript can handle it properly.

Participant
September 2, 2025

Thanks @sttk3  for the insights!

  • First, could you clarify why you wouldn’t recommend directly editing the EPS file?

  • Secondly, regarding the Python + Ghostscript approach—if I downgrade the EPS to Illustrator v10 or v8, wouldn’t that risk losing some elements from the original EPS file?

Legend
September 2, 2025

> First, could you clarify why you wouldn’t recommend directly editing the EPS file?
Subsequent versions of EPS have become proprietary to Illustrator, making it difficult for external programs to edit them correctly.

 

> Secondly, regarding the Python + Ghostscript approach—if I downgrade the EPS to Illustrator v10 or v8, wouldn’t that risk losing some elements from the original EPS file?
Of course, it would most likely be risky.