Re: reading postscript file
Re: reading postscript file
- Subject: Re: reading postscript file
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 28 Jan 2004 15:20:02 -0800
On Jan 28, 2004, at 11:28 AM, Tomas Zahradnicky wrote:
I'm not sure whether I can help you but the postscript file is
entirely missing the
%%BoundingBox: 0 0 width height
The bounding box is specified by:
%%BoundingBox: minX minY maxX maxY
The postscript also does not specify the page size or anything else
that could help to understand the width and height of the image. That
implies default page size is used and it may be A4 or US letter.
It is important to distinguish between a PS document and an EPS image.
In this case I assume that the content is to be used as an image
incorporated into other documents, so it should be structured as EPS.
In an EPS file, the minimum required comments are
%!PS-Adobe-2.0 EPSF-2.0
and
%%BoundingBox: LLx LLy URx URy
IIUC (corrections welcome -- Henry?!), the page size is not a
requirement -- indeed it's not really appropriate (the bounding box is
specified). See "ENCAPSULATED POSTSCRIPT FILES Specification Version
2.0", Adobe Systems Inc.
mmalc
From the Adobe reference:
Here is a sample file showing the EPS Interchange (EPSI) format. The
preview section is expressed in user space and the correct comments are
included. Remember that there are 8 bits to a byte, and that it
requires 2 hexadecimal digits to represent one binary byte. Therefore
the 80-pixel width of the image requires 20 bytes of hexadecimal data,
which is (80 / 8) * 2. The PostScript language segment itself simply
draws a box, as can be seen in the last few lines.
%! PS-Adobe-2.0 EPSF-2.0
%%BoundingBox: 0 0 80 24
%%Pages: 0
%%Creator: Glenn Reid
%%CreationDate: September 19, 1988
%%EndComments
%¾ginPreview: 80 24 1 24
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FF0000000000000000FF
% FF0000000000000000FF
% FF0000000000000000FF
% FF0000000000000000FF
% FF0000000000000000FF
% FF0000000000000000FF
% FF0000000000000000FF
% FF0000000000000000FF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFF
%%EndPreview
%%EndProlog
%%Page: "one" 1
4 4 moveto 72 0 rlineto 0 16 rlineto -72 0 rlineto
closepath
8 setlinewidth stroke
%%Trailer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.