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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embedding an image

Status
Not open for further replies.

jnordell

MIS
Jan 9, 2003
6
US
Just to let you know I'm very new to PS. What I'm trying to do is embed an image inside of a postscript document. I've been trying to figure it out by reading the forums and the PostScript Language Reference and I've been unable to make anything work. We currently create postscript files though our application for reports and such. Each of these use different pre-formatted postscript header files which we use to define the layout of the documents. Years back someone encoded our company logo and added it to the header files. The problem is now they want to change the logo and I don't have a clue on how to embed the new logo into the current header files. Here is the excert of one of our ps headers where the logo definition starts:

/logo { /here save def 0 setgray .25 -.25 scale
115 -2375 translate 1108 345 true [2 0 0 2 0 0] {<

**** removed all of the hex encoded image data

>} imagemask here restore } def

This code is probably over a decade old and is probably outdated, but it works. I just need to figure out how to change this logo definition to print the new logo.

If anyone can help me out with a step by step process I would greatly appreciate it.


 
I actually have no idea. I posted everything that contains the image definition above except for the raw hex data. If you like I could email you one of the pre-defined header files for reference. It almost looks like some form of line art definition because the entire hex definition contains only 0's, 3's, C's, and F's.
 
No, I meant your new logo... surely you have a digital file of some sort. Of WHAT sort is the question?

In your code above, yeah, you'll have essentially a lot of blocks that act as a stencil. All of the &quot;ones&quot; will be painted black, all of the 0s will be left alone (letting whatever other color was already there to &quot;show through&quot;).

But now you have a new logo. There are better ways of incorporating a logo than the code you posted.

If you tell me what format your new logo is in (do you have an EPS? A JPEG? A TIFF?) then I can share some code with you.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
I can make the new logo whatever it needs to be or whatever is easiest to implement. If I would make it dynamic (meaning alling me to specify the whichever logo I wanted) and leave the rest of the ps header file alone that would be even better. I actually seen a post you did before showing how to read in a jpeg from another file, but I wasn't able to get it to work from our UNIX host without getting a file read error on printout.
 
any update on this... I really appreciate any help anyone can offer.
 
Sorry, I must have missed your post. The easiest format to implement is EPS, since it is itself PostScript.

Do you need to fully embed the logo? Or can your PostScript do file i/o?

Another way of asking this: are you sending your PostScript directly to an output device, or are you performing intermediary processing, such as turning the PostScript into a PDF via Distiller?

Also, what PostScript level does your output device or workflow support? The technique I'll suggest depends on whether you support Level 3 or Level 2.


Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
We spool the output directly to the printer so I guess I would need to embed the logo. And all of our devices are level 2 compliant.
 
Adobe has a Technical Note that addresses how to use EPS files in PostScript Language Forms, and it is written to the Level 2 spec:


That is the approach I suggest taking. If you need help in implementing it, then I'll be happy to help.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
ok... I'm looking at the document now. But I'm running into problems with the EPS. Do I need to include the entire eps file or just a specific part of it. When I try to include the entire file I'm getting offending command errors.
 
The entire EPS. Perhaps you could email me your EPS? My email address is on my website.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
I'll mention for the sake of the group that the problem was thumbnail data in the EPS.

An EPS is meant to be consumed by a Page Layout program. So, the EPS spec allows for an image thumbnail to be included in the EPS. A TIFF or PICT file for example. The layout program uses this thumbnail to show the user a nice picture of the EPS so they can place it, crop it, etc.

Some programs which output EPS files are nice and surround these images with PostScript code that protects the interpreter from the raw image data. Other programs just dump the image data in at the top of the EPS.

When you place the EPS file into a PostScript program and then interpret that PostScript program, the interpreter will choke on the raw thumbnail image data.

So when saving an EPS for use in a PostScript form, be sure to save WITHOUT thumbnail or preview image. Also, it's good to save in ASCII format.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top