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

Embedding ascii85 encoded image

Status
Not open for further replies.

rellis

Technical User
Jan 26, 2005
4
US
Hi Everyone,

Let me start off by saying I'm a Unix systems administrator, not a postscript programmer. I'm attempting to embed an ascii85 encoded image into a postscript document. I saved the image out of GIMP as postscript level 2 and encapsulated postscript. I was wondering if someone could show me the proper syntax to drop this encoded garbage into the postscript document.

Thanks,
Ron
 
Is it really an EPS? What happens, for example, when you run it through GhostScript or Distiller? Does it produce a PDF?

If so, then we can just include the image inline or use the "run" operator.

If the data is raw bitmapped image data, we need to use the image operator.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
I'd like to actually drop the encoded content into the original postscript document if possible and avoid having an "include" file. I can generate any kind of postscript you'd like me to, just let me know which (EPS,PS, or just the ASCII85 encoded image content). The data was a jpeg image of our company logo which I opened in GIMP and then saved out as postscript, GIMP just adds some header/trailer garbage and encodes the actual image in ASCII85. If i run ps2pdf against the file I get a PDF. I hope I answered your questions in full, if I failed to please let me know.

Thanks,
Ron
 
I really appreciate you taking the time to help me with this. I dropped the encapsulated postscript into the end of the file and it comes up when I view it but there's one caveat. It's on page no. 2 now. I'd like to drop the EPS file in and have it on page no. 1.

Ron Ellis
AIX Systems Administrator
Mother Lode Holding Company
 
The proper way to embed an EPS is to surround it with code that "encapsulates" the image. A sample:

save
/showpage {} def
/setpagedevice /pop load def
0 0 translate % position the image
1 1 scale % scale the image
%% place the EPS here
restore



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
I am using this code segment at the end of my postscript file to insert the encapsulated postscript. It makes the page really tall and skinny for some reason but more importantly it still does not display the image on the pages with the rest of the stuff.

save
/showpage {} def
/setpagedevice /pop load def
/RawData currentfile /ASCII85Decode filter def
/Data RawData << >> /DCTDecode filter def
20 20 translate % position the image
1 1 scale % scale the image
%% place the EPS here
%begin test eps
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: jpeg2ps V1.9 by Thomas Merz
%%Title: ptc_logo300.jpg
%%CreationDate: Wed Jan 26 11:11:26 2005
%%BoundingBox: 20 20 575 208
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
%%EndProlog
%%Page: 1 1
/DeviceGray setcolorspace
{ << /ImageType 1
/Width 3.3
/Height 2
/ImageMatrix [ 3.3 0 0 -2 0 2 ]
/DataSource Data
/BitsPerComponent 8
/Decode [0 1]
>> image
Data closefile
RawData flushfile
showpage
restore
} exec
s4IA0!"_al8O`[\!<E3P!A"3Ns5<qn7<iNY!!#_f!%IsK!!iQ)zs4[N@!!NH-"9\
f1"9\i2"U,)8$j[(C#6tbI$OI4R%h]Ke%hTBe(*",('H.\u&JuZ.)BBh?+!2.4+s
\?R,TIjI*rj"U$O?cj"HWWb+oqY]!$)%?!!3 [[[[[[[intentionally removed]]]]]]]]]]]]]
%%EOF
%end test eps
restore

Ron Ellis
AIX Systems Administrator
Mother Lode Holding Company
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top