<br>Hi,<br><br>I wonder if there is somebody who can help me<br>import/link a image in a PS-document.<br>Is there a easy way to do this?<br><br>Thank you in advance,<br>Petri<br>
The image command and the image dictionary exist to put bitmap images into PS documents. Below is a small JPEG image (hence the DCTdecode filter) embedded into a PS file for an example. I've noticed a few of your questions here, and most of them are readily answered in the PS big red book. If you need a friendlier introduction to Postscript, try using Glenn Reid's 'Thinking in Postscript', available for download at <A HREF="
that, the big red book (and the little green and blue ones), and the user groups can help you get by. In fact, the blue book has sample code which answers one of your other questions - how to do a word-splitting algorithm - I've added it at the end of this answer<br><br><br><br>0.00 rotate<br>0.00 0.00 translate<br>/infile currentfile<br>/ASCII85Decode filter<br>/DCTDecode filter def<br>/DeviceRGB setcolorspace<br>87.00 510.00 translate<br>72.00 dup 298 96.00 div mul exch 398 96.00 div mul scale<br><< /ImageType 1<br> /Width 298<br> /Height 398<br> /BitsPerComponent 8<br> /ImageMatrix [298 0 0 398 0 0]<br> /Interpolate false<br> /Decode [0 1 0 1 0 1]<br> /DataSource infile>><br>image<br>s4IA0!... lots of data goes here...unfortunately, double quotes confuse Tek-Tips editor, and there are double quotes in the data stream - I can email you the sample if you send me an address here.<br>...OhGA$s/~><br><br>Now, the word-splitting example<br><br><br>%%Title: Blue Book Program 12, on page 179<br>%%Creator: Adobe Systems Incorporated <br>%%CreationDate: Thu Dec 28 17:56:06 PST 1989<br>%%EndComments<br><br>/wordbreak ( ) def<br>/BreakIntoLines<br> { /proc exch def<br> /linelength exch def<br> /textstring exch def<br><br> /breakwidth wordbreak stringwidth pop def<br> /curwidth 0 def<br> /lastwordbreak 0 def<br> <br> /startchar 0 def<br> /restoftext textstring def<br> <br> { restoftext wordbreak search<br> { /nextword exch def pop<br> /restoftext exch def<br> /wordwidth nextword stringwidth pop def<br> <br> curwidth wordwidth add linelength gt<br> { textstring startchar<br> lastwordbreak startchar sub<br> getinterval proc<br> /startchar lastwordbreak def<br> /curwidth wordwidth breakwidth add def }<br> { /curwidth curwidth wordwidth add<br> breakwidth add def <br> } ifelse<br><br> /lastwordbreak lastwordbreak<br> nextword length add 1 add def<br> }<br> {pop exit}<br> ifelse<br> } loop<br> /lastchar textstring length def<br> textstring startchar lastchar startchar sub <br> getinterval proc<br> } def<br><br>/Times-Roman findfont 16 scalefont setfont<br>/yline 650 def<br><br>(In every period there have been better or worse\<br> types employed in better or worse ways. The\<br> better types employed in better ways have been\<br> used by the educated printer acquainted with\<br> standards and history, directed by taste and\<br> a sense of the fitness of things, and facing the\<br> industrial conditions and the needs of his time.\<br> Such men have made of printing an art. The\<br> poorer types and methods have been employed\<br> by printers ignorant of standards and caring\<br> alone for commercial success. To these, printing\<br> has been simply a trade. The typography of a\<br> nation has been good or bad as one or other of\<br> these classes had the supremacy. And to-day\<br> any intelligent printer can educate his taste, so\<br> to choose types for his work and so to use them,\<br> that he will help printing to be an art rather\<br> than a trade. \261Daniel Berkeley Updike.)<br> <br> 300<br> { 72 yline moveto dup stringwidth pop linelength exch sub 1 index length div dup 2 lt { 0 3 2 roll ashow } { pop show } ifelse<br> /yline yline 18 sub def }<br> <br>BreakIntoLines<br><br>% EXERCISE FOR THE READER: If the user specifies a short<br>% enough line length, it is possible for the typeset width <br>% of a single word to exceed the maximum line length. <br>% Modify this algorithm to handle this event gracefully.<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.