Article View: comp.lang.postscript
Article #2032Preview Bitmaps for PS and EPS files?
From: Rodney Mcduff
Date: Sun, 30 Aug 1992 05:12
Date: Sun, 30 Aug 1992 05:12
70 lines
3439 bytes
3439 bytes
It occurs to me that it would a 'good thing' to be able
to insert/append a preview bitmap into a arbitary postscript file.
With this facility one could for example import a postscript file
as a eps object into Xfig and see the bitmap displayed. (Thus one
can modify (or add to) a drawing or graph etc etc.)
So the question is "Is there some software out there that can achieve this?".
Now with the ghostscript package there exist a PS program (ps2image.ps) that
is atleast heading in the right direction. It converts a PS file
into a hex bitmap which it then reads and display. ie.
#!
# start of converted PS file
/readimage {gsave matrix setmatrix 1 matrix 3 index 7 add 8 idiv string currentfile exch
{2 copy 1 index token pop 2 index token pop getinterval readhexstring pop pop dup}
3 1 roll 7 2 roll image pop pop grestore showpage} bind def
568 736 readimage
0 71 fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
.
.
lots of hex stuff
.
.
# end of converted PS file
However what we want is something like this
%!PS-Adobe-2.0 EPSF-2.0
%%BoundingBox: 0 18 335 345
%%Title: logo.eps ( this is an example EPS file with a preview bitmap that comes with Xfig)
%%Creator: boyter
%%CreationDate: Wed Mar 27 09:22:54 1991
%%BeginPreview: 391 391 1 391
% 000000000000000000000000000000000000000000000003ffe00000000000000000000000000000000000000000000000
% 000000000000000000000000000000000000000000003ffffffffe00000000000000000000000000000000000000000000
.
.
lots of hex stuff
.
.
% 000000000000000000000000000000000000000000ffffffffffffff000000000000000000000000000000000000000000
% 000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000
%%EndPreview
.
.
Rest of original PS file
.
.
So it should be feasible that with ghostscript and an appropriate PS program one
can include/append a preview bitmap into an arbitary PS file.
--
+-------------------------+------------------------------------------+
| _ ^ _ | Rodney McDuff |
| |\ /|\ /| | Physics Department |
| \ | / | The University of Queensland |
| \ | / | St. Lucia, Brisbane |
| \|/ | Queensland, Australia. 4072. |
| <--------+--------> | |
| /|\ | TELEPHONE: +61 7 365 3424 |
| / | \ | INTERNET:mcduff@newton.physics.uq.oz.au |
| / | \ | FACSIMILE: +61 7 365 1242 |
| |/ \|/ \| | |
| - v - | |
+-------------------------+------------------------------------------+
Technical Details
Message-ID:
<Bts6H4.HA3@bunyip.cc.uq.oz.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!know!mips2!news.bbn.com!usc!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!munnari.oz.au!bunyip.cc.uq.oz.au!newton.physics.uq.oz.au!mcduffShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!know!mips2!news.bbn.com!usc!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!munnari.oz.au!bunyip.cc.uq.oz.au!newton.physics.uq.oz.au!mcduff From: mcduff@newton.physics.uq.oz.au (Rodney Mcduff) Newsgroups: comp.lang.postscript Subject: Preview Bitmaps for PS and EPS files? Message-ID: <Bts6H4.HA3@bunyip.cc.uq.oz.au> Date: 30 Aug 92 05:12:40 GMT Sender: news@bunyip.cc.uq.oz.au (USENET News System) Organization: Physics Dept. The University of Queensland Lines: 70