Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to place EPS into a PS? 1

Status
Not open for further replies.

tral

Programmer
Oct 18, 2002
5
0
0
BE
I used the article of Mr.Thomas D. Greer "Preparing EPS files for use in VDP" to put an EPS file in my PS file like this
...
save
/showpage {} def
/setpagedevice /pop load def
0 0 translate
14.2 -12.848 scale
-154 -521 translate
(G:/Output/id_2_front.eps) run
restore
...
It works fine, but if I share my PS file the fixed path (G:/Output/id_2_front.eps) causes problems for the RIP.

Is it possible to put the EPS file inside the PS file like Form and how.
I was not able to find it in Acumen Journal.
Kind regards,
Trifon Alekov
 
Hello,

Most of the time, you can simply copy the EPS into the PostScript where you want it. In effect, replace the "run" operator line in the code sample above with the entire EPS file.

This may not work with all EPS files. Also, if you are reusing the EPS multiples times within the PostScript, we need to discuss various approaches to that using the Form dictionary structure.



Thomas D. Greer
 
Forum:

Trifon and I communicated via email, but I wanted to post a complete explanation of this technique for the benefit of anyone else who might be interested.

The goal is to embed an EPS file within a PostScript program so that no external references are necessary, and to only "RIP" the EPS data once so that it can be efficiently reused throughout your program.

PostScript provides the "Form Dictionary" structure for reusable content caching. The basic structure is as follows:

Code:
/FormName
<< /FormType 1
   /BBox [0 0 612 792]
   /Matrix [1 0 0 1 0 0]
   /PaintProc
     { % some procedure to draw the &quot;form&quot;
     } bind
>> def

You've seen me use this structure with the &quot;run&quot; operator, to use an EPS file located in a locally accesible drive/folder. If we want to embed our EPS though, we can't just copy the EPS into the /PaintProc. This is because of the way PostScript tokenizes procedures. It will try to turn the contents of the EPS, including any image data, into valid PostScript tokens. When these get executed, you'll get errors, because binary or hex-encoded image data are not valid PostScript operators.

We have to use a little bit of misdirection.

The solution comes via the ReusableStreamDecode filter. Filters are used to create file objects from other file objects or strings. As the name implies, the filter object &quot;filters&quot; and/or encodes/decodes one file format into another.

The ReusableStreamDecode filter actually does no filtering at all, but it does have lots of uses which we can't go into here. But the key point is that it creates a File object. That file object can be used in our Form dictionary's PaintProc.

The Form Dictionary might look like this:

Code:
/IDForm
<< /FormType 1
   /BBox [154 321 441 521]
   /Matrix [ 1 0 0 1 0 0]
   /PaintProc
   { pop
       /ostate save def
         /showpage {} def
         /setpagedevice /pop load def
         ImageData 0 setfileposition ImageData cvx exec
       ostate restore
   } bind 
>> def

Notice the BBox entry. Take that directly out of your EPS file. The PaintProc first does a pop, this is to remove the copy of the Form dictionary that gets put there as an artifact of how execform works. Next you see the standard &quot;EPS housekeeping&quot; statements.

The magic happens with &quot;ImageData 0 setfileposition ImageData cvx exec&quot;.

ImageData is a file we created with the ReusableStreamDecode filter. We first set it back to the start. Then we put the file on the stack, change it to executable with the cvx operator, and execute it.

To draw this logo or image, we simply perform &quot;IDForm execform&quot; wherever we want the EPS to draw. Precede that statement with appropriate save, scale, and translate operators, and of course match your save with a restore.

Great, but where does the &quot;ImageData&quot; file come from?

Copy the EPS in its entirety into the very top of your PostScript program. We'll precede it with code that uses the ReusableStreamDecode filter to turn it into a file:

Code:
/ImageData
currentfile
<< /Filter /SubFileDecode
   /DecodeParms << /EODString (*EOD*) >>
>> /ReusableStreamDecode filter

Next would come our complete EPS. After the EPS code, complete the file definition with:

Code:
*EOD*
def

Notice the &quot;*EOD*&quot;. This can be any string at all. We're telling the ReusableStreamDecode filter to stop when it encounters that string. Then the def, to associate the filtered file object with the /ImageData definition.

Here's a completed code segment:

Code:
%!PS

/ImageData
currentfile
<< /Filter /SubFileDecode
   /DecodeParms << /EODString (*EOD*) >>
>> /ReusableStreamDecode filter
%% ommitted EPS, could be hundreds of lines!
*EOD*
def

/IDForm
<< /FormType 1
   /BBox [154 321 441 521]
   /Matrix [ 1 0 0 1 0 0]
   /PaintProc
   { pop
       /ostate save def
         /showpage {} def
         /setpagedevice /pop load def
         ImageData 0 setfileposition ImageData cvx exec
       ostate restore
   } bind 
>> def

And to use your EPS:

Code:
save
  14.2  -12.848 scale
  -154 -521 translate
IDForm execform
restore

Apologies for being long-winded. If any of this was unclear, please send me your questions.



Thomas D. Greer
 
Hi Tgreer,

I tried your code for putting an eps into a ps file, but it didn't work. did the code work for you? BTW are those '>>' signs part of the code? Is there any simple way to do the above?

Thank you.
 
Yes, the code works. It's in use in lots of high-volume production code at multiple companies/sites.

The double-angle brackets are part of the code. They are a level-2 shorthand for defining a dictionary. (That's something to check; are you using a PostScript Level 2 device?)

First, does the EPS need to be actually inside the PostScript? Or would your workflow allow you refer to an EPS on the file system? For example, if you are processing your PostScript on a local system or server to produce a PDF file.

The simplest way to use an EPS is with the &quot;run&quot; operator. Barring that, you can copy the EPS into the code right where you need it to run, just be sure to protect your program as I explain here:
If you want to re-use the EPS multiple times, then follow the intructions in this thread. If you'd like, send me the program that you've written and I'll debug it.

Thomas D. Greer
 
Hi Tgreer,
thanks for your response. below is my ps code, I was unable to view it by GSview, also I sent it to our ps printer but nothing happened.
I appreciate your help
thank you,

below is the complete code with the eps in it:
----------------------------------------------
%!PS

/ImageData
pstest.ps
<< /Filter /SubFileDecode
/DecodeParms << /EODString (*EOD*) >>
>> /ReusableStreamDecode filter
%% ommitted EPS, could be hundreds of lines!
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: EpsGraphics2D 0.3.1 by Paul Mutton, %%Title: barcode.eps
%%CreationDate: Thu Nov 06 11:00:39 PST 2003
%%DocumentData: Clean7Bit
%%BoundingBox: 8 -101 209 -54
%%DocumentProcessColors: Black
%%ColorUsage: Color
%%Origin: 8 -101
%%Pages: 1
%%Page: 1 1
%%EndComments

gsave
0.0 0.0 0.0 setrgbcolor
0.0 0.0 0.0 setrgbcolor
/dialog findfont 12 scalefont setfont
1.0 setlinewidth
10.0 setmiterlimit
0 setlinejoin
2 setlinecap
[ ] 0 setdash
1.0 1.0 1.0 setrgbcolor
%fill
newpath
10.0 -56.0 moveto
30.0 -56.0 lineto
30.0 -80.0 lineto
10.0 -80.0 lineto
10.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
30.0 -56.0 moveto
34.0 -56.0 lineto
34.0 -80.0 lineto
30.0 -80.0 lineto
30.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
34.0 -56.0 moveto
36.0 -56.0 lineto
36.0 -80.0 lineto
34.0 -80.0 lineto
34.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
36.0 -56.0 moveto
38.0 -56.0 lineto
38.0 -80.0 lineto
36.0 -80.0 lineto
36.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
38.0 -56.0 moveto
42.0 -56.0 lineto
42.0 -80.0 lineto
38.0 -80.0 lineto
38.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
42.0 -56.0 moveto
48.0 -56.0 lineto
48.0 -80.0 lineto
42.0 -80.0 lineto
42.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
48.0 -56.0 moveto
52.0 -56.0 lineto
52.0 -80.0 lineto
48.0 -80.0 lineto
48.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
52.0 -56.0 moveto
54.0 -56.0 lineto
54.0 -80.0 lineto
52.0 -80.0 lineto
52.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
54.0 -56.0 moveto
60.0 -56.0 lineto
60.0 -80.0 lineto
54.0 -80.0 lineto
54.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
60.0 -56.0 moveto
64.0 -56.0 lineto
64.0 -80.0 lineto
60.0 -80.0 lineto
60.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
64.0 -56.0 moveto
66.0 -56.0 lineto
66.0 -80.0 lineto
64.0 -80.0 lineto
64.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
66.0 -56.0 moveto
72.0 -56.0 lineto
72.0 -80.0 lineto
66.0 -80.0 lineto
66.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
72.0 -56.0 moveto
74.0 -56.0 lineto
74.0 -80.0 lineto
72.0 -80.0 lineto
72.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
74.0 -56.0 moveto
76.0 -56.0 lineto
76.0 -80.0 lineto
74.0 -80.0 lineto
74.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
76.0 -56.0 moveto
82.0 -56.0 lineto
82.0 -80.0 lineto
76.0 -80.0 lineto
76.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
82.0 -56.0 moveto
86.0 -56.0 lineto
86.0 -80.0 lineto
82.0 -80.0 lineto
82.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
86.0 -56.0 moveto
88.0 -56.0 lineto
88.0 -80.0 lineto
86.0 -80.0 lineto
86.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
88.0 -56.0 moveto
94.0 -56.0 lineto
94.0 -80.0 lineto
88.0 -80.0 lineto
88.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
94.0 -56.0 moveto
96.0 -56.0 lineto
96.0 -80.0 lineto
94.0 -80.0 lineto
94.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
96.0 -56.0 moveto
98.0 -56.0 lineto
98.0 -80.0 lineto
96.0 -80.0 lineto
96.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
98.0 -56.0 moveto
104.0 -56.0 lineto
104.0 -80.0 lineto
98.0 -80.0 lineto
98.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
104.0 -56.0 moveto
108.0 -56.0 lineto
108.0 -80.0 lineto
104.0 -80.0 lineto
104.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
108.0 -56.0 moveto
110.0 -56.0 lineto
110.0 -80.0 lineto
108.0 -80.0 lineto
108.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
110.0 -56.0 moveto
116.0 -56.0 lineto
116.0 -80.0 lineto
110.0 -80.0 lineto
110.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
116.0 -56.0 moveto
118.0 -56.0 lineto
118.0 -80.0 lineto
116.0 -80.0 lineto
116.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
118.0 -56.0 moveto
122.0 -56.0 lineto
122.0 -80.0 lineto
118.0 -80.0 lineto
118.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
122.0 -56.0 moveto
124.0 -56.0 lineto
124.0 -80.0 lineto
122.0 -80.0 lineto
122.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
124.0 -56.0 moveto
128.0 -56.0 lineto
128.0 -80.0 lineto
124.0 -80.0 lineto
124.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
128.0 -56.0 moveto
132.0 -56.0 lineto
132.0 -80.0 lineto
128.0 -80.0 lineto
128.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
132.0 -56.0 moveto
136.0 -56.0 lineto
136.0 -80.0 lineto
132.0 -80.0 lineto
132.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
136.0 -56.0 moveto
140.0 -56.0 lineto
140.0 -80.0 lineto
136.0 -80.0 lineto
136.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
140.0 -56.0 moveto
146.0 -56.0 lineto
146.0 -80.0 lineto
140.0 -80.0 lineto
140.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
146.0 -56.0 moveto
148.0 -56.0 lineto
148.0 -80.0 lineto
146.0 -80.0 lineto
146.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
148.0 -56.0 moveto
156.0 -56.0 lineto
156.0 -80.0 lineto
148.0 -80.0 lineto
148.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
156.0 -56.0 moveto
158.0 -56.0 lineto
158.0 -80.0 lineto
156.0 -80.0 lineto
156.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
158.0 -56.0 moveto
160.0 -56.0 lineto
160.0 -80.0 lineto
158.0 -80.0 lineto
158.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
160.0 -56.0 moveto
162.0 -56.0 lineto
162.0 -80.0 lineto
160.0 -80.0 lineto
160.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
162.0 -56.0 moveto
166.0 -56.0 lineto
166.0 -80.0 lineto
162.0 -80.0 lineto
162.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
166.0 -56.0 moveto
172.0 -56.0 lineto
172.0 -80.0 lineto
166.0 -80.0 lineto
166.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
172.0 -56.0 moveto
178.0 -56.0 lineto
178.0 -80.0 lineto
172.0 -80.0 lineto
172.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
178.0 -56.0 moveto
180.0 -56.0 lineto
180.0 -80.0 lineto
178.0 -80.0 lineto
178.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
180.0 -56.0 moveto
182.0 -56.0 lineto
182.0 -80.0 lineto
180.0 -80.0 lineto
180.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
182.0 -56.0 moveto
184.0 -56.0 lineto
184.0 -80.0 lineto
182.0 -80.0 lineto
182.0 -56.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
%fill
newpath
184.0 -56.0 moveto
188.0 -56.0 lineto
188.0 -80.0 lineto
184.0 -80.0 lineto
184.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
188.0 -56.0 moveto
208.0 -56.0 lineto
208.0 -80.0 lineto
188.0 -80.0 lineto
188.0 -56.0 lineto
closepath
fill
newpath
1.0 1.0 1.0 setrgbcolor
%fill
newpath
10.0 -80.0 moveto
208.0 -80.0 lineto
208.0 -100.0 lineto
10.0 -100.0 lineto
10.0 -80.0 lineto
closepath
fill
newpath
0.0 0.0 0.0 setrgbcolor
/Arial findfont 20 scalefont setfont
%fill
newpath
71.57715 -99.625 moveto
71.57715 -96.203125 lineto
65.3584 -96.203125 lineto
65.3584 -94.578125 lineto
71.88965 -85.3125 lineto
73.32715 -85.3125 lineto
73.32715 -94.578125 lineto
75.26465 -94.578125 lineto
75.26465 -96.203125 lineto
73.32715 -96.203125 lineto
73.32715 -99.625 lineto
71.57715 -99.625 lineto
closepath
71.57715 -94.578125 moveto
71.57715 -88.125 lineto
67.09277 -94.578125 lineto
71.57715 -94.578125 lineto
closepath
82.700195 -99.625 moveto
82.700195 -96.203125 lineto
76.481445 -96.203125 lineto
76.481445 -94.578125 lineto
83.012695 -85.3125 lineto
84.450195 -85.3125 lineto
84.450195 -94.578125 lineto
86.387695 -94.578125 lineto
86.387695 -96.203125 lineto
84.450195 -96.203125 lineto
84.450195 -99.625 lineto
82.700195 -99.625 lineto
closepath
82.700195 -94.578125 moveto
82.700195 -88.125 lineto
78.21582 -94.578125 lineto
82.700195 -94.578125 lineto
closepath
93.82324 -99.625 moveto
93.82324 -96.203125 lineto
87.60449 -96.203125 lineto
87.60449 -94.578125 lineto
94.13574 -85.3125 lineto
95.57324 -85.3125 lineto
95.57324 -94.578125 lineto
97.51074 -94.578125 lineto
97.51074 -96.203125 lineto
95.57324 -96.203125 lineto
95.57324 -99.625 lineto
93.82324 -99.625 lineto
closepath
93.82324 -94.578125 moveto
93.82324 -88.125 lineto
89.33887 -94.578125 lineto
93.82324 -94.578125 lineto
closepath
104.94629 -99.625 moveto
104.94629 -96.203125 lineto
98.72754 -96.203125 lineto
98.72754 -94.578125 lineto
105.25879 -85.3125 lineto
106.69629 -85.3125 lineto
106.69629 -94.578125 lineto
108.63379 -94.578125 lineto
108.63379 -96.203125 lineto
106.69629 -96.203125 lineto
106.69629 -99.625 lineto
104.94629 -99.625 lineto
closepath
104.94629 -94.578125 moveto
104.94629 -88.125 lineto
100.461914 -94.578125 lineto
104.94629 -94.578125 lineto
closepath
116.069336 -99.625 moveto
116.069336 -96.203125 lineto
109.850586 -96.203125 lineto
109.850586 -94.578125 lineto
116.381836 -85.3125 lineto
117.819336 -85.3125 lineto
117.819336 -94.578125 lineto
119.756836 -94.578125 lineto
119.756836 -96.203125 lineto
117.819336 -96.203125 lineto
117.819336 -99.625 lineto
116.069336 -99.625 lineto
closepath
116.069336 -94.578125 moveto
116.069336 -88.125 lineto
111.58496 -94.578125 lineto
116.069336 -94.578125 lineto
closepath
127.19238 -99.625 moveto
127.19238 -96.203125 lineto
120.97363 -96.203125 lineto
120.97363 -94.578125 lineto
127.50488 -85.3125 lineto
128.94238 -85.3125 lineto
128.94238 -94.578125 lineto
130.87988 -94.578125 lineto
130.87988 -96.203125 lineto
128.94238 -96.203125 lineto
128.94238 -99.625 lineto
127.19238 -99.625 lineto
closepath
127.19238 -94.578125 moveto
127.19238 -88.125 lineto
122.70801 -94.578125 lineto
127.19238 -94.578125 lineto
closepath
132.6748 -92.5625 moveto
132.6748 -90.03125 132.6748 -90.03125 133.19824 -88.47656 curveto
133.72168 -86.921875 133.72168 -86.921875 134.75293 -86.08594 curveto
135.78418 -85.25 135.78418 -85.25 137.34668 -85.25 curveto
138.50293 -85.25 138.50293 -85.25 139.37012 -85.71094 curveto
140.2373 -86.171875 140.2373 -86.171875 140.7998 -87.046875 curveto
141.3623 -87.921875 141.3623 -87.921875 141.69043 -89.17969 curveto
142.01855 -90.4375 142.01855 -90.4375 142.01855 -92.5625 curveto
142.01855 -95.078125 142.01855 -95.078125 141.49512 -96.625 curveto
140.97168 -98.171875 140.97168 -98.171875 139.94824 -99.02344 curveto
138.9248 -99.875 138.9248 -99.875 137.34668 -99.875 curveto
135.26855 -99.875 135.26855 -99.875 134.09668 -98.390625 curveto
132.6748 -96.59375 132.6748 -96.59375 132.6748 -92.5625 curveto
closepath
134.4873 -92.5625 moveto
134.4873 -96.09375 134.4873 -96.09375 135.30762 -97.25781 curveto
136.12793 -98.421875 136.12793 -98.421875 137.34668 -98.421875 curveto
138.5498 -98.421875 138.5498 -98.421875 139.37793 -97.25 curveto
140.20605 -96.078125 140.20605 -96.078125 140.20605 -92.5625 curveto
140.20605 -89.03125 140.20605 -89.03125 139.37793 -87.86719 curveto
138.5498 -86.703125 138.5498 -86.703125 137.33105 -86.703125 curveto
136.1123 -86.703125 136.1123 -86.703125 135.39355 -87.734375 curveto
134.4873 -89.03125 134.4873 -89.03125 134.4873 -92.5625 curveto
closepath
143.79785 -92.5625 moveto
143.79785 -90.03125 143.79785 -90.03125 144.32129 -88.47656 curveto
144.84473 -86.921875 144.84473 -86.921875 145.87598 -86.08594 curveto
146.90723 -85.25 146.90723 -85.25 148.46973 -85.25 curveto
149.62598 -85.25 149.62598 -85.25 150.49316 -85.71094 curveto
151.36035 -86.171875 151.36035 -86.171875 151.92285 -87.046875 curveto
152.48535 -87.921875 152.48535 -87.921875 152.81348 -89.17969 curveto
153.1416 -90.4375 153.1416 -90.4375 153.1416 -92.5625 curveto
153.1416 -95.078125 153.1416 -95.078125 152.61816 -96.625 curveto
152.09473 -98.171875 152.09473 -98.171875 151.07129 -99.02344 curveto
150.04785 -99.875 150.04785 -99.875 148.46973 -99.875 curveto
146.3916 -99.875 146.3916 -99.875 145.21973 -98.390625 curveto
143.79785 -96.59375 143.79785 -96.59375 143.79785 -92.5625 curveto
closepath
145.61035 -92.5625 moveto
145.61035 -96.09375 145.61035 -96.09375 146.43066 -97.25781 curveto
147.25098 -98.421875 147.25098 -98.421875 148.46973 -98.421875 curveto
149.67285 -98.421875 149.67285 -98.421875 150.50098 -97.25 curveto
151.3291 -96.078125 151.3291 -96.078125 151.3291 -92.5625 curveto
151.3291 -89.03125 151.3291 -89.03125 150.50098 -87.86719 curveto
149.67285 -86.703125 149.67285 -86.703125 148.4541 -86.703125 curveto
147.23535 -86.703125 147.23535 -86.703125 146.5166 -87.734375 curveto
145.61035 -89.03125 145.61035 -89.03125 145.61035 -92.5625 curveto
closepath
fill
newpath
/dialog findfont 12 scalefont setfont
0.0 0.0 0.0 setrgbcolor
grestore

%%EOF
*EOD* def

/IDForm
<< /FormType 1
/BBox [8 -101 209 -54]
/Matrix [ 1 0 0 1 0 0]
/PaintProc
{ pop
/ostate save def
/showpage {} def
/setpagedevice /pop load def
ImageData 0 setfileposition ImageData cvx exec
ostate restore
} bind
>> def

save
14.2 -12.848 scale
-154 -521 translate
IDForm execform
restore
 
1) Near the top, change &quot;pstest.ps&quot; to &quot;currentfile&quot;.

2) Remove &quot;%% ommitted EPS, could be hundreds of lines!&quot;

3) At the very end, you need to scale and translate appropriate to your specific image. For example, since your bounding box starts the image 8 points left and 101 points down, you might want to reverse that with your translate: -8 101 translate.

4) End your program with &quot;showpage&quot;.

Thomas D. Greer
 
Tgreer,
Thanks for your response. I did all those changes but it still doesn't work. Could you view/print the page?

here are the changes that I made:

pstest.ps -> currentfile
removed %% ommitted...
ended the program with:
save
1 1 scale
-8 101 translate
IDForm execform
restore
showpage
 
Yes, it showed a barcode at the bottom of the page. Can you email me the file? Don't post it in the forum, it takes too much space. You can find my email address on my website.



Thomas D. Greer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top