[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Repeatedly including an EPS file
From: |
Valeriy E. Ushakov |
Subject: |
Re: Repeatedly including an EPS file |
Date: |
Sat, 3 Feb 2001 22:45:20 +0300 |
User-agent: |
Mutt/1.3.3i |
On Sat, Feb 03, 2001 at 20:44:09 +0300, Valeriy E. Ushakov wrote:
> > Can anyone advise a technique for defining the logo once and
> > referencing it "symbolically".
>
> See Adobe Technote #5144 "Using EPS Files in PostScript Language Forms"
>
> http://partners.adobe.com/asn/developer/pdfs/tn/5144.pdf
Ok, this seems interesting, so I've given it a try. First of all you
need a Level 2 printer, that understands forms. Section 3 of the
technote explains how you can use copypage with Level 1 interpreters
if you will use the EPS only once per page, but I haven't tried that
approach.
. Technote example defines its own code to bracket EPS files. Lout
also defines such code.
It's possible to reuse Lout versions, but you need to patch Lout
code for BeginEPSF and EndEPSF to match the one found in TN5144.
Note that Lout code is taken from EPSF spec, apparently that code
doesn't work well for forms. I haven't looked close into it, I just
changed the code to match the one found in the tech note:
in BeginEPSF move "userdict begin" to the bery begining of the def
in EndEPSF and "end" at the very end
These are hardcoded in z49.c, so either tweak it and recompile or
patch the produced output.
Since that's a hassle, you can just ignore it and use a version from
the technote.
. You have to know the BBox of the EPS and tell it to Lout. When Lout
includes EPS files it reads the BBox information for DSC comments,
but since in this case Lout will *not* be reading the file, you have
to tell it the size of the picture.
. There's a wart. @PrependGraphic only adds things to prologue, and
you want the form with your EPS to be in the setup. Also, you
probably want to end (pop) the form dictionary in the document
trailer and Lout doesn't provide necessary hooks.
So you will need:
* the .lpg resource file with common code and @PrependGraphic for it
The code is on pages 7-8 of TN 5144, it's the resource forms_ops
starting with:
%%BeginResource: procset forms_ops 1.0 0
NB: If you modified Lout Begin/EndEPSF for reuse with forms, you
can delete StartEPSF and EPSFCleanUp from this resource (but see
warning below).
NB: You will want to delete /ARRAY_SIZE definition from that
resource. It changes from file to file so you'd better define it on
a per-EPS basis.
* an .lpg file with your EPS wrapped in a form and @PrependGraphic for it
This is the setup code on page 8 of the tech note. Copy the stuff
between %%BeginSetup and %%EndSetup comments, change the form name.
NB: You want to put the ARRAY_SIZE (that example code defines in
prolog) into the form dictionary!
NB: If you modified Lout Begin/EndEPSF for reuse with forms, you can
use them instead.
Update the BBbox entry and paste the EPS file at the indicated place.
* a Lout definition that invokes the form
Now things are all set and you can do:
# SU Crest logo from the User's Guide
def @Crest {
{
20 dup scale # undo Lout scaling to it's internal unit
CrestForm execform
} @Graphic
# Tell Lout the size of the EPS picture
60p @Wide 53p @High
}
And then just use @Crest as any other Lout object. BTW, if the form
is cached you will save rendering time as well as file size (see
section 7.2 of the tech note).
I guess that you can easily automate all this stuff with a script.
SY, Uwe
--
address@hidden | Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen