What is an AI file? | Knowledge Base
Introduction
AI files are files created and used by Adobe Illustrator graphics editor. They are written in PostScript language, which you can read about in the article “What is PS file?”. Remind that PostScript language syntax has postfix notation in Backus−Naur form (BNF).
operand1...operandm operator |
Also as you can remember PS files minimally have a structure, consisting of Prolog and Script parts.
%!PS-Adobe-3.0 EPSF |
Prolog is a part where necessary data for subsequent script, rendering and printing is defined. This data can include the version of Postscript language, bounding box, creator, creation date and title. Necessary fonts, global variables and procedures are also should be defined here. Procedures are combined in procsets, dictionaries where every procedure is connected to the literal name. And every procsets also has a name. In case of EPS file when necessary font or other resource is not defined in Prolog it should be at least noted with corresponding comments %%DocumentNeededFonts, %%DocumentNeededResources,%%DocumentNeededProcSets, %%DocumentNeededFiles. Script contains page graphics descriptions that use procedures, global variables and fonts defined earlier in Prolog. Structure of PS/EPS files is marked by special structural comments, lines that begin with %%.
What is .ai file?
AI file or abbreviated Adobe Illustrator file is actually EPS file, as it is claimed by Adobe in AI specification. It contains two comments that are required in EPS files:
%!PS-Adobe-3.0 EPSF |
%%BoundingBox: ... |
Differences between AI and EPS files.
The main difference is operators. Adobe Illustrator operators are one or two-symbols sequences, while PS/EPS use human-readable keywords that contain usually more than 2 letters.
Adobe Illustrator uses more than 130 such 1-2-letter operators and definitions of them are not stored in Prolog of AI file, as It would be in the case of EPS file, but are stored somewhere in Adobe Illustrator application. Very likely they are loaded in memory when the application starts. And this is the second main difference between EPS and AI files.
Thus, AI files can be treated as EPS files only in case when Adobe Illustrator is used for creating, editing, viewing, and printing them. For external consumers, who do not have access to licensed stuff of Adobe Illustrator not included in Prolog of AI file, that is AI operators definitions, procedure sets, fonts, etc., AI format should be considered as a separate brand new file format.
Some AI operators are just short forms of PS operators, as is shown below.
AI operator x y m | Native PS operator x y moveto | Description starts a new subpath of the current path |
Others represent a more detailed form of PS operators.
AI operator x2 y2 x3 y3 v, x2 y2 x3 y3 V | Description adds a Bezier curve segment to the current path between the current point and the point x3, y3, using the current point and then x2, y2 as the Bezier direction points |
And there are brand new operators, for example those who deal with text, gradients or layers.
AI operator N | Description neither fills nor strokes, leaving it as an open path |
It is worth mentioning especially grouping operators. They are composed from begin and end operators and have other operators between them.
AI operator *u ... *U | Description begin compound path, end compound path |
The third difference is pseudo comments. As we already know PostScript interpreter distinguishes standard comments, lines that begin with ‘%’ and structural comments that begin with ‘%%’. Adobe Illustrator adds additional, so-called, “pseudo” comments, that begin with ‘%_’. These comments are actually brand new, peculiar to Adobe Illustrator, operators. They are implemented as comments in order to be ignored by the PostScript interpreter but are used by Adobe Illustrator and other applications that read and parse AI files. Below is an example of such comments-operators.
AI operator colorSpec colorStyle midPoint rampPoint %_Bs | Description gradient color stop description |
The last difference between AI and EPS files is Revisable Form. Adobe separates Revisable Form and Final Form of a document. Final Form contains only information necessary for viewing or printing pages. Revisable Form contains other stuff that can be used for editing documents in an application but is not necessary for printing. Some AI operators exist only for Revisable Form. Especially many of these operators are used in working with text. Pseudo comments are all used for Revisable Form. EPS files, in contrast, are documents in Final Form.
What is AI File used for?
AI file is used for editing, transferring and storing Adobe Illustrator application graphics.
How do I open an AI File?
AI files can be opened and viewed with standalone Adobe Illustrator application. You can also use AI Viewer from Aspose to open ypur document. It is a cross-platform app that does not require installation.
Is PDF the same as AI File?
No, they are different formats and languages. Though PDF and AI files have the same internal page description model, PDF is a static Page Description Language, while AI is a subset of PostScript, dynamic Page Description Language.