EPS基本文件格式

1. Required DSC Header Comments

有两条注释是必需的

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: llx lly urx ury

第一行注释表明该文件符合EPSF 3.0格式。
第二行注释的四个参数对应左下角(lower-left)和右上角(upper-right)的边框,使用默认的PS坐标系表示。对于EPS文件,边框是在单页上包含所有形状的最小矩形。图形状态信息,如当前线宽和线连接参数,在计算时必须考虑边框。

例子:

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 5 5 105 105
10 setlinewidth
10 10 moveto
0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
stroke

2. Conditionally Required Comments

下面的一些DSC注释是可选的,但当这些特性被使用时,必须写上注释

用于EPSI交换格式:

%%BeginPreview
%%EndPreview

使用了操作符拓展,如CMYK:

%%Extensions

使用了PS1之外的语言特性:

%%LanguageLevel

高精度边框

%%HiResBoundingBox

3 Recommended Comments

作者

%%Creator

标题

%%Title

创建日期

%%CreationDate

总页数

%%pages 总页数

文件头结束

%%EndComments

文件结束

%%EOF

页码

%%page name number

一个例子

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: potrace 1.10, written by Peter Selinger 2001-2011
%%LanguageLevel: 2
%%BoundingBox: 0 0 256 256
%%HiResBoundingBox: 0 0 256.000000 256.000000
%%Pages: 1
%%EndComments
%%Page: 1 1
save
1.000000 1.000000 scale
0 setgray
59 214 moveto
-5 -3 -7 -17 -3 -44 rcurveto
3 -23 4 -39 4 -59 rcurveto
0 -17 rlineto
4 0 rlineto
4 0 rlineto
0 19 rlineto
1 11 2 25 3 33 rcurveto
0 7 2 17 2 22 rcurveto
2 14 2 38 0 42 rcurveto
-2 4 -8 6 -14 4 rcurveto
closepath
fill
57 64 moveto
-8 -5 -8 -20 1 -24 rcurveto
9 -5 20 2 20 12 rcurveto
0 11 -12 17 -21 12 rcurveto
closepath
fill
restore
%%EOF

参考资料

“Encapsulated PostScript File Format Specification Version3.0”, 1 May 1992.

猜你喜欢

转载自blog.csdn.net/crf_moonlight/article/details/77702694