Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse Adobe Illustrator (.ai) files with Python

I'm using Python under Linux. Could you please recommend some libs or command line tools to parse Adobe Illustrator (.ai) files which I can use in my Python program?

What I need to do includes:

  1. Convert .ai files to .jpeg or .png images
  2. Extract text from .ai files
  3. Read .ai files information (e.g. version number, something like psdparse for AI)

I need it under Ubuntu so I cannot use win32com

like image 635
jack Avatar asked Nov 21 '11 07:11

jack


People also ask

Can you Export AI to HTML?

ai2html is an open-source script for Adobe Illustrator that converts your Illustrator documents into html and css. Here are examples of how we've used the script at The New York Times and examples of how others have used it. Share your ai2html projects on Twitter, Delicious, etc. using #ai2html.


1 Answers

I think many modern .AI files are just extended PDF files. A quick test would be: rename the .AI to .PDF and see if your PDF reader can open it. If so, there are plenty of tools to deal with PDF files.

If you have older .AI files then you can try Uniconvertor. It is Python, perhaps you can import some functionality from it.

[update]

This answer is quite old. If it does not work for you leave a comment with what went wrong.

like image 131
Paulo Scardine Avatar answered Sep 25 '22 00:09

Paulo Scardine