HOME

TheInfoList



OR:

PostScript (PS) is a page description language and
dynamically typed In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usua ...
, stack-based programming language. It is most commonly used in the
electronic publishing Electronic publishing (also referred to as e-publishing, digital publishing, or online publishing) includes the digital publication of e-books, digital magazines, and the development of digital libraries and catalogues. It also includes the ed ...
and
desktop publishing Desktop publishing (DTP) is the creation of documents using dedicated software on a personal ("desktop") computer. It was first used almost exclusively for print publications, but now it also assists in the creation of various forms of online co ...
realm, but as a
Turing complete Alan Mathison Turing (; 23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalyst, philosopher and theoretical biologist. He was highly influential in the development of theoretical comput ...
programming language, it can be used for many other purposes as well. PostScript was created at
Adobe Systems Adobe Inc. ( ), formerly Adobe Systems Incorporated, is an American software, computer software company based in San Jose, California. It offers a wide range of programs from web design tools, photo manipulation and vector creation, through to ...
by John Warnock, Charles Geschke, Doug Brotz, Ed Taft and Bill Paxton from 1982 to 1984. The most recent version, PostScript 3, was released in 1997.


History

The concepts of the PostScript language were seeded in 1976 by John Gaffney at Evans & Sutherland, a
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
company. At that time, Gaffney and John Warnock were developing an interpreter for a large three-dimensional graphics database of
New York Harbor New York Harbor is a bay that covers all of the Upper Bay. It is at the mouth of the Hudson River near the East River tidal estuary on the East Coast of the United States. New York Harbor is generally synonymous with Upper New York Bay, ...
. Concurrently, researchers at Xerox PARC had developed the first
laser printer Laser printing is an electrostatic digital printing process. It produces high-quality text and graphics (and moderate-quality photographs) by repeatedly passing a laser beam back and forth over a Electric charge, negatively charged cylinder call ...
and had recognized the need for a standard means of defining page images. In 1975–76 Bob Sproull and William Newman developed the Press format, which was eventually used in the
Xerox Star The Xerox Star workstation, officially named Xerox Star 8010 Information System, is the first commercial personal computer to incorporate technologies that have since become standard in personal computers, including a bitmapped display, a window- ...
system to drive laser printers. But Press, a data format rather than a language, lacked flexibility, and PARC mounted the Interpress effort to create a successor. In 1978, John Gaffney and Martin Newell then at Xerox PARC wrote J & M or JaM (for "John and Martin") which was used for VLSI design and the investigation of type and graphics printing. This work later evolved and expanded into the Interpress language. Warnock left with Chuck Geschke and founded
Adobe Systems Adobe Inc. ( ), formerly Adobe Systems Incorporated, is an American software, computer software company based in San Jose, California. It offers a wide range of programs from web design tools, photo manipulation and vector creation, through to ...
in December 1982. They, together with Doug Brotz, Ed Taft and Bill Paxton created a simpler language, similar to Interpress, called PostScript, which went on the market in 1984. Meanwhile, in the spring of 1983,
Steve Jobs Steven Paul Jobs (February 24, 1955 – October 5, 2011) was an American businessman, inventor, and investor best known for co-founding the technology company Apple Inc. Jobs was also the founder of NeXT and chairman and majority shareholder o ...
came to visit Adobe and was dazzled by PostScript's potential, especially for the new
Macintosh Mac is a brand of personal computers designed and marketed by Apple Inc., Apple since 1984. The name is short for Macintosh (its official name until 1999), a reference to the McIntosh (apple), McIntosh apple. The current product lineup inclu ...
computer he was developing at
Apple An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
. To John Sculley's frustration, Jobs licensed the PostScript technology from Adobe by offering a $1.5 million advance against PostScript royalties, plus $2.5 million in exchange for 20 percent of Adobe shares. During a series of meetings in 1983, Jobs also repeatedly offered for Apple to buy Adobe outright, but the founders kept turning him down. In December 1983, the two companies finally signed off on the PostScript licensing deal, and Adobe had to shift focus immediately from high-end, high-resolution printing devices to the consumer-oriented Apple
LaserWriter The LaserWriter is a laser printer with built-in PostScript interpreter sold by Apple, Inc. from 1985 to 1988. It was one of the first laser printers available to the mass market. In combination with WYSIWYG publishing software like PageMaker ...
laser printer. At that time, the 300-dpi
Canon Canon or Canons may refer to: Arts and entertainment * Canon (fiction), the material accepted as officially written by an author or an ascribed author * Literary canon, an accepted body of works considered as high culture ** Western canon, th ...
laser printing engine to be used in LaserWriters was seen as good enough only for proof printing (i.e., for crude rough drafts of material whose final drafts would be sent to professional high-resolution devices), but Jobs presented Adobe with the challenge of making PostScript render high-quality output to such a low-resolution device (which for most consumers would be their only printing device). In response, Warnock and Brotz solved the so-called "appearance problem" of making the stem width of letters scale properly so that they look good at all resolutions. Their breakthrough was so important that Adobe has never patented the technology, in order to keep its details concealed as a
trade secret A trade secret is a form of intellectual property (IP) comprising confidential information that is not generally known or readily ascertainable, derives economic value from its secrecy, and is protected by reasonable efforts to maintain its conf ...
. Paxton worked on several other related improvements, such as font hinting. Adobe was also responsible for porting PostScript to the Canon's
Motorola 68000 The Motorola 68000 (sometimes shortened to Motorola 68k or m68k and usually pronounced "sixty-eight-thousand") is a 16/32-bit complex instruction set computer (CISC) microprocessor, introduced in 1979 by Motorola Semiconductor Products Sector ...
chip. Apple and Adobe announced the LaserWriter at Apple's annual stockholder meeting on January 23, 1985. It was the first printer to ship with PostScript, sparking the
desktop publishing Desktop publishing (DTP) is the creation of documents using dedicated software on a personal ("desktop") computer. It was first used almost exclusively for print publications, but now it also assists in the creation of various forms of online co ...
(DTP) revolution in the mid-1980s. The original PostScript royalty was five percent of the list price for each laser printer sold, which was $350 of the original LaserWriter list price of $6,995, and such royalties provided nearly all of Adobe's income during its early years. (Apple later renegotiated the contract to pay a licensing fee based on volume of printers shipped.) The combination of technical merits and widespread availability made PostScript the language of choice for graphical output for printing applications. An interpreter (sometimes referred to as a RIP for Raster Image Processor) for the PostScript language was a common component of laser printers during the 1980s and 1990s. However, the cost of implementation was high; computers output raw PS code that would be interpreted by the printer into a raster image at the printer's natural resolution. This required high-performance
microprocessor A microprocessor is a computer processor (computing), processor for which the data processing logic and control is included on a single integrated circuit (IC), or a small number of ICs. The microprocessor contains the arithmetic, logic, a ...
s and ample
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
. The LaserWriter used a 12 MHz
Motorola 68000 The Motorola 68000 (sometimes shortened to Motorola 68k or m68k and usually pronounced "sixty-eight-thousand") is a 16/32-bit complex instruction set computer (CISC) microprocessor, introduced in 1979 by Motorola Semiconductor Products Sector ...
, making it faster than any of the Macintosh computers to which it was attached. When the laser printer engines themselves cost over a thousand dollars, the added cost of PS was marginal. But, as printer mechanisms fell in price, the cost of implementing PS became too great a fraction of overall printer cost. In addition, with desktop computers becoming more powerful during the 1990s than their attached printers, it no longer made sense to offload the rasterization work onto the resource-constrained printer. By 2001, few low-end printer models came with onboard support for PostScript, largely due to growing competition from much cheaper non-PostScript inkjet printers, and new software-based methods to render PostScript images on computers, making them suitable for any printer.
PDF Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
, a descendant of PostScript, provides one such method, and has largely replaced PostScript as the '' de facto'' standard for electronic document distribution. On high-end printers, PostScript processors remain common, and their use can dramatically reduce the CPU work involved in printing documents, transferring the work of rendering PostScript images from the computer to the printer.


PostScript Level 1

The first version of the PostScript language was released to the market in 1984. The qualifier ''Level 1'' was added when ''Level 2'' was introduced.


PostScript Level 2

PostScript Level 2 was introduced in 1991, and included several improvements: improved speed and reliability, support for in-Raster Image Processing (RIP) separations, image decompression (for example,
JPEG JPEG ( , short for Joint Photographic Experts Group and sometimes retroactively referred to as JPEG 1) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degr ...
images could be rendered by a PostScript program), support for composite fonts, and the form mechanism for caching reusable content.


PostScript 3

PostScript 3 (Adobe dropped the "level" terminology in favor of simple versioning) came at the end of 1997, and along with many new dictionary-based versions of older operators, introduced better color handling and new filters (which allow in-program compression/decompression, program chunking, and advanced error handling). PostScript 3 was significant in terms of replacing the existing proprietary color electronic prepress systems, then widely used for magazine production, through the introduction of smooth shading operations with up to 4096 shades of grey (rather than the 256 available in PostScript Level 2), as well as DeviceN, a
color space A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represe ...
that allowed the addition of additional ink colors (called
spot color In offset printing, a spot color or solid color is any color generated by an ink (pure or mixed) that is printed using a ''single run'', whereas a process color is produced by printing a series of dots of different colors. The widespread offset- ...
s) into composite color pages.


Use in printing


Before PostScript

Prior to the introduction of Interpress and PostScript, printers were designed to print character output given the text—typically in
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
—as input. There were a number of technologies for this task, but most shared the property that the
glyph A glyph ( ) is any kind of purposeful mark. In typography, a glyph is "the specific shape, design, or representation of a character". It is a particular graphical representation, in a particular typeface, of an element of written language. A ...
s were physically difficult to change, as they were stamped onto
typewriter A typewriter is a Machine, mechanical or electromechanical machine for typing characters. Typically, a typewriter has an array of Button (control), keys, and each one causes a different single character to be produced on paper by striking an i ...
keys, bands of metal, or optical plates. This changed to some degree with the increasing popularity of dot matrix printers. The characters on these systems were drawn as a series of dots, as defined by a
font In metal typesetting, a font is a particular size, weight and style of a ''typeface'', defined as the set of fonts that share an overall design. For instance, the typeface Bauer Bodoni (shown in the figure) includes fonts " Roman" (or "regul ...
table inside the printer. As they grew in sophistication, dot matrix printers started including several built-in fonts from which the user could select, and some models allowed users to upload their own custom glyphs into the printer. Dot matrix printers also introduced the ability to print
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
. The graphics were interpreted by the computer and sent as a series of dots to the printer using a series of
escape sequence In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters. Examples * In C and ma ...
s. These
printer control language In digital printing, a page description language (PDL) is a computer language that describes the appearance of a printed page in a higher level than an actual output bitmap (or generally raster graphics). An overlapping term is printer control ...
s varied from printer to printer, requiring program authors to create numerous drivers.
Vector graphics Vector graphics are a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector displ ...
printing was left to special-purpose devices, called
plotter A plotter is a machine that produces vector graphics drawings. Plotters draw lines on paper using a pen, or in some applications, use a knife to cut a material like Polyvinyl chloride, vinyl or leather. In the latter case, they are sometimes k ...
s. Almost all plotters shared a common command language, HPGL, but were of limited use for anything other than printing graphics. In addition, they tended to be expensive and slow, and thus rare.


PostScript printing

Laser printers combine the best features of both printers and plotters. Like plotters, laser printers offer high-quality line art, and like dot-matrix printers, they are able to generate pages of text and raster graphics. Unlike either printers or plotters, a laser printer makes it possible to position high-quality graphics and text on the same page. PostScript made it possible to fully exploit these characteristics by offering a single control language that could be used on any brand of printer. PostScript went beyond the typical printer control language and was a complete programming language of its own. Many applications can transform a document into a PostScript program, the execution of which results in the original document. This program can be sent to an interpreter in a printer, which results in a printed document, or to one inside another application, which will display the document on-screen. Since the document-program is the same regardless of its destination, it is called ''device-independent''. PostScript is noteworthy for implementing on-the-fly rasterization in which everything, even text, is specified in terms of straight lines and cubic
Bézier curve A Bézier curve ( , ) is a parametric equation, parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approxima ...
s (previously found only in CAD applications), which allows arbitrary scaling, rotating and other transformations. When the PostScript program is interpreted, the interpreter converts these instructions into the dots needed to form the output. For this reason, PostScript interpreters are occasionally called PostScript
raster image processor A raster image processor (RIP) is a component used in a printing system which produces a raster image also known as a bitmap. Such a bitmap is used by a later stage of the printing system to produce the printed output. The input may be a page ...
s, or RIPs.


Font handling

Almost as complex as PostScript itself is its handling of fonts. The font system uses the PS graphics primitives to draw glyphs as curves, which can then be rendered at any resolution. A number of typographic issues had to be considered with this approach. One issue is that fonts do not scale linearly at small sizes and features of the glyphs will become proportionally too large or small and start to look displeasing. PostScript avoided this problem with the inclusion of font hinting, in which additional information is provided in horizontal or vertical bands to help identify the features in each letter that are important for the rasterizer to maintain. The result was significantly better-looking fonts even at low resolution. It had formerly been believed that hand-tuned bitmap fonts were required for this task. At the time, the technology for including these hints in fonts was carefully guarded, and the hinted fonts were compressed and encrypted into what Adobe called a '' Type 1 Font'' (also known as ''PostScript Type 1 Font'', ''PS1'', ''T1'' or ''Adobe Type 1''). Type 1 was effectively a simplification of the PS system to store outline information only, as opposed to being a complete language (PDF is similar in this regard). Adobe would then sell licenses to the Type 1 technology to those wanting to add hints to their own fonts. Those who did not license the technology were left with the '' Type 3 Font'' (also known as ''PostScript Type 3 Font'', ''PS3'' or ''T3''). Type 3 fonts allowed for all the sophistication of the PostScript language, but without the standardized approach to hinting. The Type 2 font format was designed to be used with Compact Font Format (CFF) charstrings, and was implemented to reduce the overall font file size. The CFF/Type2 format later became the basis for handling PostScript outlines in
OpenType OpenType is a format for scalable computer fonts. Derived from TrueType, it retains TrueType's basic structure but adds many intricate data structures for describing typographic behavior. OpenType is a registered trademark of Microsoft Corpora ...
fonts. The CID-keyed font format was also designed, to solve the problems in the OCF/Type 0 fonts, for addressing the complex Asian-language ( CJK) encoding and very large character set issues. The CID-keyed font format can be used with the Type 1 font format for standard CID-keyed fonts, or Type 2 for CID-keyed OpenType fonts. To compete with Adobe's system, Apple designed their own system,
TrueType TrueType is an Computer font#Outline fonts, outline font standardization, standard developed by Apple Inc., Apple in the late 1980s as a competitor to Adobe Inc., Adobe's PostScript fonts#Type 1, Type 1 fonts used in PostScript. It has become the ...
, around 1991. Immediately following the announcement of TrueType, Adobe published the specification for the Type 1 font format. Retail tools such as Altsys
Fontographer Fontographer is a font editor for Windows and macOS; it is used to create digital fonts. It was originally developed by Altsys but is now owned by FontLab Ltd. History Altsys Corporation In December 1984, James R. Von Ehr II founded the Alt ...
(acquired by
Macromedia Macromedia, Inc. was an American graphics, multimedia, and web development software company headquartered in San Francisco, California, that made products such as Adobe Flash, Flash and Adobe Dreamweaver, Dreamweaver. It was purchased by its riv ...
in January 1995, owned by FontLab since May 2005) added the ability to create Type 1 fonts. Since then, many free Type 1 fonts have been released; for instance, the fonts used with the
TeX Tex, TeX, TEX, may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Tex Earnhardt (1930–2020), U.S. businessman * Joe Tex (1933–1982), stage name of American soul singer ...
typesetting system are available in this format. In the early 1990s, there were several other systems for storing outline-based fonts, developed by
Bitstream A bitstream (or bit stream), also known as binary sequence, is a sequence of bits. A bytestream is a sequence of bytes. Typically, each byte is an 8-bit quantity, and so the term octet stream is sometimes used interchangeably. An octet may ...
and Metafont for instance, but none included a general-purpose printing solution and they were therefore not widely used. In the late 1990s, Adobe joined Microsoft in developing
OpenType OpenType is a format for scalable computer fonts. Derived from TrueType, it retains TrueType's basic structure but adds many intricate data structures for describing typographic behavior. OpenType is a registered trademark of Microsoft Corpora ...
, essentially a functional superset of the Type 1 and TrueType formats. When printed to a PostScript output device, the unneeded parts of the OpenType font are omitted, and what is sent to the device by the driver is the same as it would be for a TrueType or Type 1 font, depending on which kind of outlines were present in the OpenType font. Adobe supported Type 1 fonts in its products until January 2023, when it fully removed support in favor of OpenType fonts.


Other implementations

In the 1980s, Adobe drew most of its revenue from the licensing fees for their implementation of PostScript for printers, known as a
raster image processor A raster image processor (RIP) is a component used in a printing system which produces a raster image also known as a bitmap. Such a bitmap is used by a later stage of the printing system to produce the printed output. The input may be a page ...
or ''RIP''. As a number of new
RISC In electronics and computer science, a reduced instruction set computer (RISC) is a computer architecture designed to simplify the individual instructions given to the computer to accomplish tasks. Compared to the instructions given to a comp ...
-based platforms became available in the mid-1980s, some found Adobe's support of the new machines to be lacking. This and issues of cost led to third-party implementations of PostScript becoming common, particularly in low-cost printers (where the licensing fee was the sticking point) or in high-end typesetting equipment (where the quest for speed demanded support for new platforms faster than Adobe could provide). At one point, Microsoft licensed to Apple a PostScript-compatible interpreter it had bought called TrueImage, and Apple licensed to Microsoft its new font format,
TrueType TrueType is an Computer font#Outline fonts, outline font standardization, standard developed by Apple Inc., Apple in the late 1980s as a competitor to Adobe Inc., Adobe's PostScript fonts#Type 1, Type 1 fonts used in PostScript. It has become the ...
. Apple ended up reaching an accord with Adobe and licensed genuine PostScript for its printers, but TrueType became the standard outline font technology for both Windows and the Macintosh. Today, third-party PostScript-compatible interpreters are widely used in printers and multifunction peripherals (MFPs). For example, CSR plc's IPS PS3 interpreter, formerly known as PhoenixPage, is standard in many printers and MFPs, including those developed by
Hewlett-Packard The Hewlett-Packard Company, commonly shortened to Hewlett-Packard ( ) or HP, was an American multinational information technology company. It was founded by Bill Hewlett and David Packard in 1939 in a one-car garage in Palo Alto, California ...
and sold under the LaserJet and Color LaserJet lines. Other third-party PostScript solutions used by print and MFP manufacturers include Jaws and the Harlequin RIP, both by Global Graphics. A
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
version, with several other applications, is Ghostscript. Several compatible interpreters are listed on the Undocumented Printing Wiki. Some basic, inexpensive laser printers do not support PostScript, instead coming with drivers that simply rasterize the platform's native graphics formats rather than converting them to PostScript first. When PostScript support is needed for such a printer, Ghostscript can be used. There are also a number of commercial PostScript interpreters, such as TeleType Co.'s ''T-Script'' or
Brother A brother (: brothers or brethren) is a man or boy who shares one or more parents with another; a male sibling. The female counterpart is a sister. Although the term typically refers to a family, familial relationship, it is sometimes used ende ...
's ''BR-Script3''.


Use as a display system

PostScript became commercially successful due to the introduction of the
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
(GUI), allowing designers to directly lay out pages for eventual output on laser printers. However, the GUIs' own graphics systems were generally much less sophisticated than PostScript; Apple's
QuickDraw QuickDraw was the 2D graphics library and associated application programming interface (API) which is a core part of classic Mac OS. It was initially written by Bill Atkinson and Andy Hertzfeld. QuickDraw still existed as part of the libraries ...
, for instance, supported only basic lines and arcs, not the complex
B-spline In numerical analysis, a B-spline (short for basis spline) is a type of Spline (mathematics), spline function designed to have minimal Support (mathematics), support (overlap) for a given Degree of a polynomial, degree, smoothness, and set of bre ...
s and advanced region filling options of PostScript. In order to take full advantage of PostScript printing, applications on the computers had to re-implement those features using the host platform's own graphics system. This led to numerous issues where the on-screen layout would not exactly match the printed output, due to differences in the implementation of these features. As computer power grew, it became possible to host the PS system in the computer rather than the printer. This led to the natural evolution of PS from a printing system to one that could also be used as the host's own graphics language. There were numerous advantages to this approach; not only did it help eliminate the possibility of different output on screen and printer, but it also provided a powerful graphics system for the computer, and allowed the printers to be "dumb" at a time when the cost of the laser engines was falling. In a production setting, using PostScript as a display system meant that the host computer could render low-resolution to the screen, higher resolution to the printer, or simply send the PS code to a smart printer for offboard printing. However, PostScript was written with printing in mind, and had numerous features that made it unsuitable for direct use in an interactive display system. In particular, PS was based on the idea of collecting up PS commands until the showpage command was seen, at which point all of the commands read up to that point were interpreted and output. In an interactive system, this was clearly not appropriate, nor did PS have any sort of interactivity built in; for example, supporting hit detection for mouse interactivity obviously did not apply when PS was being used on a printer. When
Steve Jobs Steven Paul Jobs (February 24, 1955 – October 5, 2011) was an American businessman, inventor, and investor best known for co-founding the technology company Apple Inc. Jobs was also the founder of NeXT and chairman and majority shareholder o ...
left Apple and started
NeXT NeXT, Inc. (later NeXT Computer, Inc. and NeXT Software, Inc.) was an American technology company headquartered in Redwood City, California that specialized in computer workstations for higher education and business markets, and later develope ...
, he pitched Adobe on the idea of using PS as the display system for his new workstation computers. The result was Display PostScript, or DPS. DPS added basic functionality to improve performance by changing many string lookups into 32 bit integers, adding support for direct output with every command, and adding functions to allow the GUI to inspect the diagram. Additionally, a set of "bindings" was provided to allow PS code to be called directly from the
C programming language C (''pronounced'' '' – like the letter c'') is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of ...
. NeXT used these bindings in their
NeXTStep NeXTSTEP is a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT, founded by Steve Jobs, in the late 1980s and early 1990s and was initially used for its ...
system to provide an
object oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
graphics system. Although DPS was written in conjunction with NeXT, Adobe sold it commercially and it was a common feature of most
Unix workstation A workstation is a special computer designed for technical or computational science, scientific applications. Intended primarily to be used by a single user, they are commonly connected to a local area network and run multi-user operating syste ...
s in the 1990s.
Sun Microsystems Sun Microsystems, Inc., often known as Sun for short, was an American technology company that existed from 1982 to 2010 which developed and sold computers, computer components, software, and information technology services. Sun contributed sig ...
took another approach, creating
NeWS News is information about current events. This may be provided through many different Media (communication), media: word of mouth, printing, Mail, postal systems, broadcasting, Telecommunications, electronic communication, or through the te ...
. Instead of DPS's concept of allowing PS to interact with C programs, NeWS instead extended PS into a language suitable for running the entire GUI of a computer. Sun added a number of new commands for timers, mouse control, interrupts and other systems needed for interactivity, and added
data structure In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
s and language elements to allow it to be completely object oriented internally. A complete GUI, three in fact, were written in NeWS and provided for a time on their workstations. However, the ongoing efforts to standardize the X11 system led to its introduction and widespread use on Sun systems, and NeWS never became widely used.


Portable Document Format

PDF and PostScript share the same imaging model, and both documents are mutually convertible to each other. Both documents produce the same result when printed. The difference between PDF and PostScript is that PDF lacks the general-purpose programming language framework of the PostScript language. A PDF document is a static data structure made for efficient access and embeds navigational information suitable for interactive viewing.


The language

PostScript is a
Turing-complete In computability theory, a system of data-manipulation rules (such as a model of computation, a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be ...
programming language, belonging to the concatenative group of programming languages. It is an interpreted, stack-based language similar to Forth but with strong dynamic
typing Typing is the process of writing or inputting text by pressing keys on a typewriter, computer keyboard, mobile phone, or calculator. It can be distinguished from other means of text input, such as handwriting recognition, handwriting and speech ...
, data structures inspired by those found in
Lisp Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation. Originally specified in the late 1950s, ...
, scoped memory and, since language level 2, garbage collection. The language syntax uses
reverse Polish notation Reverse Polish notation (RPN), also known as reverse Łukasiewicz notation, Polish postfix notation or simply postfix notation, is a mathematical notation in which operators ''follow'' their operands, in contrast to prefix or Polish notation ...
, which makes the order of operations unambiguous, but reading a program requires some practice, because one has to keep the layout of the
stack Stack may refer to: Places * Stack Island, an island game reserve in Bass Strait, south-eastern Australia, in Tasmania’s Hunter Island Group * Blue Stack Mountains, in Co. Donegal, Ireland People * Stack (surname) (including a list of people ...
in mind. Most ''operators'' (what other languages term ''functions'') take their arguments from the stack, and place their results onto the stack. '' Literals'' (for example, numbers) have the effect of placing a copy of themselves on the stack. Sophisticated data structures can be built on the ''array'' and ''dictionary'' types, but cannot be declared to the type system, which sees them all only as arrays and dictionaries, so any further typing discipline to be applied to such user-defined "types" is left to the code that implements them. The character "%" is used to introduce comments in PostScript programs. As a convention, every PostScript program should start with the characters "%!PS" as an interpreter directive so that all devices will properly interpret it as PostScript. PostScript programs are typically divided into two parts, conventionally called the ''prolog'' and the ''script''. The prolog contains procedures and is written by a programmer. The script passes data to those procedures. The script is often generated automatically, using a programming language other than PostScript.Adobe Systems Inc. ''PostScript Language Reference Manual , 2nd ed., Appendix G, Document Structuring Conventions-Version 3.0''. Addison Wesley, 1990, p. 611.


"Hello world"

A
Hello World program Hello is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses ''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich Cou ...
, the customary way to show a small example of a complete program in a given language, might look like this in PostScript (level 2): %!PS /Courier % name the desired font 20 selectfont % choose the size in points and establish % the font as the current one 72 500 moveto % position the current point at % coordinates 72, 500 (the origin is at the % lower-left corner of the page) (Hello world!) show % paint the text in parentheses showpage % print all on the page or if the output device has a console %!PS (Hello world!) =


Units of length

PostScript uses the point as its unit of length. However, unlike some of the other versions of the point, PostScript uses exactly 72 points to the inch. Thus: : For example, in order to draw a vertical line of 4 cm length, it is sufficient to type: 0 0 moveto 0 113.385827 rlineto stroke More readably and idiomatically, one might use the following equivalent, which demonstrates a simple procedure definition and the use of the mathematical operators mul and div: /cm def % 1 inch = 2.54 cm exactly 0 0 moveto 0 4 cm rlineto stroke (Technically, most printers have a construction-implied unprintable margin around the physical borders of the sheet, and the 0 0 coordinates are calibrated to its corner, so you might have to use a different starting point to actually see something.) Most implementations of PostScript use single-precision reals (24-bit mantissa), so it is not meaningful to use more than 9 decimal digits to specify a real number, and performing calculations may produce unacceptable round-off errors.


Software

Software which can be used to render PostScript documents: * Ghostscript * pstoedit * Zathura * Vim


See also

* Adobe StandardEncoding (PostScript character set) *
Document Structuring Conventions Document Structuring Conventions (DSC) is a set of standards for PostScript, based on the use of comments, that specifies a way to structure a PostScript file and a way to expose that structure in a machine-readable way. A PostScript file that conf ...
* Encapsulated PostScript *
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
* PostScript Printer Description (PPD) * Printer Command Language (PCL) *
Forth (programming language) Forth is a stack-oriented programming language and interactive integrated development environment designed by Charles H. "Chuck" Moore and first used by other programmers in 1970. Although not an acronym, the language's name in its early years ...


References


Further reading

* (NB. This book (''PLR3'') together with the is the ''de facto'' defining work on PostScript 3 and is informally called "red book" due to its red cover.) * (NB. This edition (''PLR2'') covers PostScript Level 2 and also contains a description of Display PostScript, which is no longer discussed in the third edition.) * (NB. This edition (''PLR1'') covers PostScript Level 1.) * (NB. This introductory text is informally called "blue book" due to its blue cover.) * (NB. This book is informally called "green book" due to its green cover.) * (NB. This book is informally called "black book" due to its black cover.) * (NB. Official introductory comparison of PS, EPS vs. PDF.) *

* (NB. A thorough tutorial available online courtesy of the author.)


External links


Computer History Museum: article about early development of PostScript
{{DEFAULTSORT:Postscript PostScript, Adobe Inc. Computer printing Programming languages created in 1982 Concatenative programming languages Digital press Digital typography Dynamically typed programming languages Office document file formats Open formats Page description languages Printing technology Stack-based virtual machines Stack-oriented programming languages Technical communication Vector graphics