Embedding EPS into PS.. example please!

Embedding EPS into PS.. example please!

Post by paul.chapm » Tue, 27 Jul 2004 19:24:50


I have a postscript file which is generated by drawing graphics commands in
Windows, and then printing that to a postscript printer driver, and
redirecting it to a file.

So far so good.

Now I need to parse that postscript file, and embed EPS graphics into it.
Does anyone have an example of this please? I dont know what headers to
strip off the eps (if any), or what are valid locations in the PS file to
begin embedding it.

Ive read the FAQ on Postscript wikipedia but the process for embedding EPS
seems quite complicated.

Thanks

Paul
 
 
 

Embedding EPS into PS.. example please!

Post by quit » Tue, 27 Jul 2004 19:36:03


None. Though if the EPS has a Windows-format preview it must be
stripped.


Anywhere that it is valid - virtually between any two lines. However,
you must also include the EPS wrapper before and after. You will also
run into the issue that the CTM may well not be the default, so you
may need to allow for that. If you want to maintain DSC compliance
you should also use %%BeginDocument: and %%EndDocument lines around
the EPS.

It is not too complex a task BUT it is one that will be very difficult
if you aren't willing, to some degree, to become a PostScript
programmer. I think that is probably why the FAQ (which seems to
accurately describe the process) does not give a recipe; using a
recipe without the programming knowledge just isn't likely to work.
----------------------------------------
Aandi Inston XXXX@XXXXX.COM http://www.yqcomputer.com/
Please support usenet! Post replies and follow-ups, don't e-mail them.

 
 
 

Embedding EPS into PS.. example please!

Post by paul.chapm » Tue, 27 Jul 2004 19:58:39

Thanks for the advice.
I already am a postscript programmer to some degree, our current
publications use raw postscript which was all hand coded by myself.
Im familiar with all the graphical commands, but it was just a bit
confusing when it came to EPS, especially as the postscript produced by the
printer driver is obviously massively more convulted than mine.

I think ive got it working now, I wasnt stripping the preview. Now I just
need to reposition the bounding box and I should be home free !

Thanks

Paul

XXXX@XXXXX.COM (Aandi Inston) wrote in
< XXXX@XXXXX.COM >:
 
 
 

Embedding EPS into PS.. example please!

Post by quit » Tue, 27 Jul 2004 20:04:43


An excellent start.


Unfortunately much PostScript is virtually "write only", with all
comments, indenting etc. stripped for some (imagined?) performance
gains...

Beware that Windows will sometimes reposition the CTM origin to top
left and set a user space unit to an arbitrary value which varies by
driver instance.
----------------------------------------
Aandi Inston XXXX@XXXXX.COM http://www.yqcomputer.com/
Please support usenet! Post replies and follow-ups, don't e-mail them.
 
 
 

Embedding EPS into PS.. example please!

Post by paul.chapm » Fri, 30 Jul 2004 19:44:33

Is there anything I can do about this? I think I may have hit upon this
problem because the EPS file im embedding is supposed to be the same size
as the page, but instead in gsview it appears very small indeed

Thanks
 
 
 

Embedding EPS into PS.. example please!

Post by quit » Fri, 30 Jul 2004 20:20:38


The problem is in general a difficult one; you are modifying a program
by adding new parts to the program. As with any other program, there
could be all sorts of side effects.

However, there is one trick. You cannot do this if inserting an EPS
into something that is intended to be an EPS, but otherwise it often
works. That is to add, somewhere after the save and before you
reposition the CTM, "initmatrix".
----------------------------------------
Aandi Inston XXXX@XXXXX.COM http://www.yqcomputer.com/
Please support usenet! Post replies and follow-ups, don't e-mail them.
 
 
 

Embedding EPS into PS.. example please!

Post by paul.chapm » Fri, 30 Jul 2004 22:06:18

oh wow, in 10 seconds youve just solved a LOT of the problems Ive spent all
day on!

Thanks Aandi :)

Paul

XXXX@XXXXX.COM (Aandi Inston) wrote in
< XXXX@XXXXX.COM >: