Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PS/EPS Dimensions with Illustrator
Taking advantage of Ken's insight, I solved the separate fill/path
problem by generating postscript without an outline, and then
replacing ghostscript's /f macro with a function that does the gsave-
stroke-grestore-fill trick.  A  hack, but it works.

My customer needs to open my files in Illustrator, however, and the
document needs to be the right size.  When I open the document in
Illustrator, Illustrator chooses an arbitrary page size instead of
reflecting the parameters passed to setpagedevice or even the
PageBoundingBox DSC comment.

I recognize that EPS files don't actually have a positioning size like
most artwork formats -- consumer applications tend to use the bounding
box, but that bounding box is supposed to minimize whitespace, not
specify a desirable coordinate space.  So that's probably where
Illustrator is coming from.

But is there some trick that lets me do what I want?  I tried changing
the size in Illustrator, saving as an EPS, and examining the output,
but the "real" EPS in the document doesn't inherit the size
information, only the proprietary blob at the end of the file.

-Adam

Report this thread to moderator Post Follow-up to this message
Old Post
Adam Augusta
03-29-08 12:22 AM


Re: PS/EPS Dimensions with Illustrator
In article <6ac3ee5c-25f4-47aa-9ec7-feb1b371d4a4
@a1g2000hsb.googlegroups.com>, roxton@gmail.com says...

> My customer needs to open my files in Illustrator, however, and the
> document needs to be the right size.  When I open the document in
> Illustrator, Illustrator chooses an arbitrary page size instead of
> reflecting the parameters passed to setpagedevice or even the
> PageBoundingBox DSC comment.
>
> I recognize that EPS files don't actually have a positioning size like
> most artwork formats -- consumer applications tend to use the bounding
> box, but that bounding box is supposed to minimize whitespace, not
> specify a desirable coordinate space.  So that's probably where
> Illustrator is coming from.
>
> But is there some trick that lets me do what I want?  I tried changing
> the size in Illustrator, saving as an EPS, and examining the output,
> but the "real" EPS in the document doesn't inherit the size
> information, only the proprietary blob at the end of the file.

Hmm, I'm not sure what the problem is exactly. If you open the EPS in
Illustrator it doesn't respect the BoundingBox comments ? I'm not too
sure how AI works but that doesn't totally surprise me.

So you changed the page size in Illustrator and saved the file back out,
as EPS or as PostScript ?

Then examining the original EPS in the output file its 'size
information' (BoundingBox ?) didn't change. If you saved it as a
PostScript file I'm not surprised, that's how EPS is supposed to be
used, the PostScript will have the 'correct' size and the EPS will be
placed within the requested media.

Or did you save it as an EPS ? If so I'm still not surprised that the
'original' EPS is unchanged, I'd expect AI to wrap the original (and any
extra stuff) inside its own EPS wrapper. So the outer EPS has the
correct BoundingBox and the EPS wrapper places the inner EPS within it.

But probably I just don't understand the problem ;-)



Ken

Report this thread to moderator Post Follow-up to this message
Old Post
ken
03-29-08 09:40 AM


Re: PS/EPS Dimensions with Illustrator
On Mar 29, 5:08 am, ken <k...@spamcop.net> wrote:
> Hmm, I'm not sure what the problem is exactly. If you open the EPS in
> Illustrator it doesn't respect the BoundingBox comments ? I'm not too
> sure how AI works but that doesn't totally surprise me.

That wouldn't be so strange, right, because that's how EPSes are
supposed to work (although I wish Adobe had done things differently).

But even if I open a straight-up postscript document, I have the
problem.

Basically, I need to create a postscript file such that when my
customer opens it in Illustrator, he sees the artwork placed where I
specified on a (for example) 7"x9" document.  I'm not sure it's
possible, but if it isn't, it would really ruin my w. :)

-Adam

Report this thread to moderator Post Follow-up to this message
Old Post
Adam Augusta
04-01-08 09:45 AM


Re: PS/EPS Dimensions with Illustrator
In article <22a8de58-894b-4c7c-8fcd-
9f133701256d@u69g2000hse.googlegroups.com>, roxton@gmail.com says...

> But even if I open a straight-up postscript document, I have the
> problem.
>
> Basically, I need to create a postscript file such that when my
> customer opens it in Illustrator, he sees the artwork placed where I
> specified on a (for example) 7"x9" document.  I'm not sure it's
> possible, but if it isn't, it would really ruin my w. :)

Sorry for the delay Adam, my Usenet feed had a bad time over April Fools
Day :-(

The trouble here, I think, is that you are really asking questions about
the behaviour of Illustrator, rather than PostScript, and since I don't
have a copy of Illustrator, I'm not really in a position to help.

However I suspect that Illustrator just opens the PS/EPS file without
regard for any non-printing elements, like comments. While better than
nothing, I've never found AI to be 100% at reading PostScript, it
doesn't implement some operators at all.

It used to be the case that when creating an EPS (or a PDF file now)
Illustrator would (at least sometimes) embed teh entire .ai file as
comments in the job. When the file was opened, instead of parsing the
PostScript, AI would read the embedded job.

However, unless you are using Illustrator yourself (in which case, just
exchange .AI files ;-) I don't think this will help you.

Sorry, but this is really a question for a different forum I think. Have
you tried any of the Adobe forums ? Perhasp someone else has solved a
similar problem.



Ken

Report this thread to moderator Post Follow-up to this message
Old Post
ken
04-02-08 09:44 AM


Re: PS/EPS Dimensions with Illustrator
On Mar 31, 8:23=A0am, Adam  Augusta <rox...@gmail.com> wrote:
> On Mar 29, 5:08 am, ken <k...@spamcop.net> wrote:
> 
>
> That wouldn't be so strange, right, because that's how EPSes are
> supposed to work (although I wish Adobe had done things differently).
>
> But even if I open a straight-up postscript document, I have the
> problem.
>
> Basically, I need to create a postscript file such that when my
> customer opens it in Illustrator, he sees the artwork placed where I
> specified on a (for example) 7"x9" document. =A0I'm not sure it's
> possible, but if it isn't, it would really ruin my w. :)
>
> -Adam

This is definitely strange. It's related to clipping, I think. Here's
my test EPS:

%!PS-Adobe-3.1 EPSF-3.0
%%BoundingBox: 0 0 612 396
%%HiResBoundingBox: 0 0 612 396
%%CropBox: 0 0 612 396
%%LanguageLevel: 2
%%DocumentData: Clean7Bit
%%Pages: 1
%%EndComments
%%BeginProlog
/imgstr
< FF00000000000000FFFF000000000000FFFFFF00
00
 000000FFFFFFFF00000000FFFFFFFFFF000000FF
FFF
 FFFFFFF0000FFFFFFFFFFFFFF00FFFFFFFFFFFFF
FFF>
def
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
%%EndPageComments
%%BeginPageSetup
%0 0 moveto 612 0 lineto 612 396 lineto 0 396 lineto closepath clip
newpath
%%EndPageSetup
%300 -12 translate
8 8 8 [.1 0 0 .1 0 -3] {imgstr} image
/Helvetica findfont 24 scalefont setfont
15 0 moveto (Stairs)show
%%PageTrailer
%%Trailer
%%EOF

It's trying to place a small image of some stairs with a text label on
a half-letter page. Opening this EPS in Illustrator (13.0.1 Win):

1. As is, the pic shows up centered in a half-letter page (612 x 396)
2. After un-commenting the line in PageSetup that does the clip: pic
is now centered (as opposed to lower-left justified) on lower-left
origin of the half-letter page (so some of the pic is now off the
page)
3.  After un-commenting the line after EndPageSetup that does the
translate: pic is now centered again in the middle of the page, but
some letters are missing from the text label (note: a, r, and s are
missing, they are not as tall as S, t, and i).

Apparently, when I try to translate something in this context,
Illustrator checks to see which parts are still in the clip box; parts
outside are discarded and parts inside are moved to the center,
regardless of where I was trying to translate them. So the "300 -12
translate" moved the pic down to the point where the short letters a,
r, and s are now out of the clip box, so they're gone. But the S, t,
and i are all a bit taller than x-height, so their top parts must have
still been projecting into the clip box, so they were preserved and
moved to the center, as was the image of the stairs. A buggy-looking
result, even if the behavior is intended (results may vary with
different fonts having different x-heights).

Ken's right; this isn't any kind of standard Postscript and so maybe
the discussion belongs in an AI forum. I don't know about current
versions of AI but in the past AI used a different (less capable) PS
interpreter than the standard Adobe PS interpreter that you see in
printers and in Distiller. So that could explain some of the
unexpected behavior.

-David W.

Report this thread to moderator Post Follow-up to this message
Old Post
deedubman@gmail.com
04-03-08 12:41 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PostScript archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:33 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.