Postscript ========== Postscript is a page description and programming language. `gv` can view postscript files, and also provides useful ps tools. ## Hello, world ## hello.ps: %!PS-Adobe-3.0 %%Pages: 2 %%DocumentData: Clean7Bit %%LanguageLevel: 3 %%DocumentMedia: Letter 612 792 0 () () %%Page: 1 1 %%BeginPageSetup %%PageOrientation: Portrait %%EndPageSetup /Times-Bold findfont 30 scalefont setfont 100 300 moveto (Hello, world! Page 1) show showpage %%Page: 2 2 %%BeginPageSetup %%PageOrientation: Portrait %%EndPageSetup /Times-Bold findfont 30 scalefont setfont 100 300 moveto (Hello, world! Page 2) show showpage %%EOF Coordinates are measured in points, and originate from the bottom left of the page. Note that the blank line after the header is required. ## Including An Image ## (I ripped the image data out of a ps I saved out of Gimp.) hello-img.ps: %!PS-Adobe-3.0 %%Pages: 1 %%DocumentData: Clean7Bit %%LanguageLevel: 3 %%DocumentMedia: Letter 612 792 0 () () %%Page: 1 1 %%BeginPageSetup %%PageOrientation: Portrait %%EndPageSetup /Times-Bold findfont 30 scalefont setfont 200 300 moveto (Hello, world!) show % Translate for offset 100 100 translate % Translate to begin of first scanline 0 67.679999999999993 translate 46.799999999999997 -67.679999999999993 scale % Image geometry 65 94 8 % Transformation matrix [ 65 0 0 94 0 0 ] currentfile /ASCII85Decode filter /RunLengthDecode filter %%BeginData: 1551 ASCII Bytes image hZ*?Nm/Q_XquH6dp]0jaquHWpq>^^g*dq#KpaquHToqZ$BlgAh$MqZ-HlqZ,@MqZ-Knq>^gQqn,N:co`+gho)JOds8UpTquHgQq aoD2;s8U4@q>gQqaoD2;s8U4@q>gQq_#NTtq#KFSkl:>VjT"`LqZ$WroDn"Qo)J"Ujo=rPklBlG o`*kMmJlhYn,WLgoDn:Yp&FL]rr;Qimf3"\n,WCdo)S7Zr;Z?gs8Voqr;Z?gn,N=coDnjiquHWo o)S7ZrVuHhqu?WqqZ$Em!<;lqnGiLfo)SXerW)fpquH`rqZ--crr;Tjq>^EoqZ$Npr;ZWonGiOg o)SUdr;c`prW)lrqZ--c!<;Tiq>^Bnqu?Wqr;ZWonG`Lgnc8Lcr;c`prW)lrqZ--c!<;lqrVufr q#CgHnr;cWmrW)iqrW)lrquH3cqZ-Nn rW)]mrW)lrr;cfrqZ-*bqZ-NnrW)`nr;ccqr;cfrqZ-*bqZ-NnrW)`nr;ccqr;cfrqZ-*bqZ-Nn rW)`nrW)iqrW)lrqZ-*bqZ-Nnr;c]or;c`prW)lrqZ-Zrnc/[iqZ-Nnr;c]or;c`prW)lrkl:_` qZ-Qor;c]or;c`prW)lrkl:_`qZ-NnrW)fprW)fprW)lrkl:_`q>gHnrW)fprW)fprW)iql2Uha q>gHnrW)-]o`4piqZ-ZrqZ-QorW)*\p]10jqZ-Zrq>gKorW)'[q>gBlq>gQqq>gKorW(RMq>gNp qZ,(Ep]1&TnGiFdqZ,gZpAj[^r;ZWokPt;Wmf34bqZ,j[p]0^]r;ZTnlMpVZm/R"`q>fg\q#Ka\qu?Km m/Qk]lMpb]q#Kg^q#K^[qZ$BlmJm"_l2UV[q>fp_qZ,j[qZ$BlmJm%`kl:JYqZ-$`quGp[q#C6l mJm(akPt>WquH-aquGp[J,~> %%EndData showpage %%EOF ## Links ## http://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF http://paulbourke.net/dataformats/postscript/ http://www.physics.emory.edu/faculty/weeks//graphics/howtops1.html http://www.tailrecursive.org/postscript/postscript.html