Hello World (PostScript)

From LiteratePrograms

Jump to: navigation, search
Other implementations: Ada | ALGOL 68 | Alice ML | Amiga E | Applescript | AspectJ | Assembly Intel x86 Linux | Assembly Intel x86 NetBSD | AWK | bash | BASIC | Batch files | C | C, Cairo | C, Xlib | Candle | Clojure | C++ | C# | Delphi | Dylan | E | Eiffel | Erlang | Forth | FORTRAN | Fortress | Go | Groovy | Haskell | Hume | IBM PC bootstrap | Inform 7 | Java | Java, Swing | JavaScript | LaTeX | Lisp | Logo | Lua | Maple | MATLAB | Mercury | OCaml/F Sharp | occam | Oz | Pascal | Perl | PHP | Pic | PIR | PLI | PostScript | Prolog | Python | Rexx | Ruby | Scala | Scheme | Seed7 | sh | Smalltalk | SQL | Standard ML | SVG | Tcl | Tcl Tk | Visual Basic | Visual Basic .NET | XSL

A simple PostScript file which prints Hello World! in the middle of the page. PostScript is a stack based language.

<<HelloWorld.ps>>=
%!PS
%
% set up font:
%
/mainfont /Helvetica findfont 32 scalefont def
mainfont setfont
%
% Move point to specific location
%
225 450 moveto
%
% Print text on page
%
(Hello, World!) show
%
% "Show" results by printing or other method
%
showpage
Download code
Views
Personal tools