Skip to main content
Participant
January 18, 2011
Answered

Why ps specs are completely outdated?

  • January 18, 2011
  • 2 replies
  • 1437 views

In example, I need .eps file with two layers for Adobe Illustrator.

What is the format? Is only several unique peoples in Adobe knows that?

Or I want create a mesh object (actually ShadingType 6), but Illustrator doesnt respects PostScript specs again!

Insead it use a code like "/Mesh X!"

Maybe I miss something in specifications of 2004 (!) year? Please tell me if so.

Or maybe new specs are available to paid developer accounts only?

Why I`am forced to reverse thousands-line .eps files when all what I want is a couple of simple things?

This topic has been closed for replies.
Correct answer Dov Isaacs

Within PostScript itself, there is no concept of layers. Although Adobe Illustrator supports the concept of layers, the resultant PostScript and/or EPS doesn't maintain such definitions within the PostScript itself. When you save an Adobe Illustrator document as an EPS file, layer information is not stored in the PostScript, but rather, in private comment data which is absolutely not publicly documented.

Also note that Adobe Illustrator is not a general purpose PostScript or PDF editor and does not support the full PostScript or PDF specification, only the subsets that match Adobe Illustrator features.

          - Dov

2 replies

Mr__Horton
Inspiring
January 18, 2011

PostScript specs are not outdated.

Illustrator uses layers to order, organize and control Artwork. So while an EPS file is PostScript language code, part of the language includes commenting (%...) that can be utilized much like tags in html or xml (<textarea...>) that applications (ie. Illustrator) can read and act on without altering the PostScript language functions in the file. Also PostScript is a programming language, not just a set of drawing commands, so non-commented PostScript code can be used to simulate layers and/or interact with layer instructions. For example:

Excerpts from an EPS file

...

%%BeginProlog

...

/Ln /pop load def

...

%%EndProlog

...
%AI5_BeginLayer
1 1 1 1 0 0 1 1 255 79 79 0 50 Lb
(Layer 3) Ln

"%%BeginProlog" is a comment line which application programs can parse, though PostScript interpreters see it as only a comment.

"/Ln /pop load def" is PostScript language that defines a procedure, in this case procedure "Ln" is a user defined procedure that has the same function as the PostScript pop command - That is it pops the top object off of the operand stack (throws it away).

When the EPS file begins a layer the "%AI5_BeginLayer" comment line could be parsed by Illustrator as a signal to the application, but it will be ignored by a PostScript Interpreter.

"(Layer 3) Ln" puts a string "Layer 3" on the operand stack and Ln pops it off (throws it away) when in the context of a PostScript interpreter, however an application program could parse this line as easily as parsing a comment line to determine that it is in Layer 3 of the file.

Regarding code like /Mesh ...

The "/" in this case tells us that Mesh is a procedure name being defined by whatever follows it.

Mesh is not a predefined procedure in PostScript, but it is a user defined procedure and can contain other PostScript or user defined procedures to perform some function.

The most common use of user defined functions is for brevity of code, so instead of coding using "0 rmoveto" a bazillion times I might create a user defined procedure named x to do the same function like this: /x {0 rmoveto} def

Application programs like Illustrator do this extensively for a number of functions, many of which are significantly more lengthy and complicated.

I hope this helps your understanding of PostScript and Illustrator.

Lastly, you can programmatically insert Illustrator compatible "layers" and other functions in an EPS file, but more study of the concepts is where you should start, before returning to the specs.

Dov Isaacs
Dov IsaacsCorrect answer
Legend
January 18, 2011

Within PostScript itself, there is no concept of layers. Although Adobe Illustrator supports the concept of layers, the resultant PostScript and/or EPS doesn't maintain such definitions within the PostScript itself. When you save an Adobe Illustrator document as an EPS file, layer information is not stored in the PostScript, but rather, in private comment data which is absolutely not publicly documented.

Also note that Adobe Illustrator is not a general purpose PostScript or PDF editor and does not support the full PostScript or PDF specification, only the subsets that match Adobe Illustrator features.

          - Dov

- Dov Isaacs, former Adobe Principal Scientist (April 30, 1990 - May 30, 2021)
ESokolovAuthor
Participant
January 18, 2011

Though I don`t like this situation, you`re right. Sad but true.

Thank you for such a quick answer.