Content deleted Content added
→Portable Document Format: add comparison to PDF; add source Tags: Reverted Visual edit |
|||
(47 intermediate revisions by 29 users not shown) | |||
Line 1:
{{
{{Other uses|Postscript (disambiguation)}}
{{More citations needed|date=January 2019}}
{{Infobox programming language
| name = PostScript
| logo = Adobe PostScript 3 logo.svg
| logo caption = PostScript 3 logo
| paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[Concatenative programming language|concatenative]] ([[Stack-oriented programming|stack-based]]), [[Procedural programming|procedural]]
| year = {{Start date and age|1982}}
| designer = [[John Warnock]], [[Chuck Geschke]],
| developer = [[Adobe Systems]]
| latest release version = PostScript 3
| latest release date = {{Start date and age|1997}}
| typing = Dynamic, weak
| implementations = Adobe PostScript, [[TrueImage]], [[Ghostscript]]
Line 34:
| standard =
}}
'''PostScript''' (often abbreviated as '''PS''') is a [[page description language]] and [[Type system|dynamically typed]], [[Stack-oriented programming|stack-based programming language]]. It is most commonly used in the [[electronic publishing]] and [[desktop publishing]] realm
== History ==
The concepts of the PostScript language were seeded in 1976 by John Gaffney at [[Evans & Sutherland]],<ref name="reilly2003p206">{{cite book |last1=Reilly |first1=Edwin |title=Milestones in Computer Science and Information Technology |date=2003 |publisher=Greenwood Publishing Group |isbn=9781573565219 |page=[https://archive.org/details/milestonesincomp0000reil/page/206 206] |url=https://archive.org/details/milestonesincomp0000reil/page/206 }}</ref><ref>{{cite book |last1=Peterson |first1=J.K |title=Fiber Optics Illustrated Dictionary |date=Jun 28, 2018 |publisher=Taylor & Francis Group |isbn=9781138455757}}</ref><ref>{{cite book |last1=Nguyen |first1=Binh |title=Linux Dictionary |date=2004 |publisher=Binh Nguyen |edition=0.16 |access-date=28 September 2019 |url=https://play.google.com/books/reader?id=vdZWBQAAQBAJ&hl=en&pg=GBS.PP1 |archive-date=24 February 2021 |archive-url=https://web.archive.org/web/20210224140917/https://play.google.com/books/reader?id=vdZWBQAAQBAJ&hl=en&pg=GBS.PP1 |url-status=live }}</ref> a [[computer graphics]] company. At that time, Gaffney and [[John Warnock]] were developing an interpreter for a large three-dimensional graphics database of [[New York Harbor]].
Concurrently, researchers at [[Xerox PARC]] had developed the first [[laser printer]] and had recognized the need for a standard means of defining page images. In
In 1978, John Gaffney and [[Martin Newell (computer graphics)|Martin Newell]] then at Xerox PARC wrote J
Warnock left with [[Chuck Geschke]] and founded [[Adobe Systems]] in December 1982. They, together with Doug Brotz, Ed Taft and [[Bill Paxton (computer scientist)|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]] came to visit Adobe and was dazzled by PostScript's potential, especially for the new [[Macintosh 128K|Macintosh]] computer he was developing at [[Apple Inc.|Apple]].<ref name="Pfiffner_Page_33">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=33}}</ref> 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.<ref name="Pfiffner_Page_34">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=34}}</ref> During a series of meetings in 1983, Jobs also repeatedly offered for Apple to buy Adobe outright, but the founders kept turning him down.<ref name="Pfiffner_Page_34" /> 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]] laser printer.<ref name="Pfiffner_Page_35">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=35}}</ref>
At that time, the 300-dpi [[Canon Inc.|Canon]] laser printing engine to be used in LaserWriters was seen as good enough only for [[Prepress proofing|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).<ref name="Pfiffner_Page_36">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=36}}</ref> 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.<ref name="Pfiffner_Page_37">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=37}}</ref> Their breakthrough was so important that Adobe has never patented the technology, in order to keep its details concealed as a [[trade secret]].<ref name="Pfiffner_Page_37" /> Paxton worked on several other related improvements, such as [[font hinting]].<ref name="Pfiffner_Page_37" /> Adobe was also responsible for porting PostScript to the Canon's [[Motorola 68000]] chip.<ref name="Pfiffner_Page_37" />
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]]s and ample [[computer memory|memory]]. The LaserWriter used a 12 MHz [[Motorola 68000]], making it faster than any of the Macintosh computers to which it 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, it no longer made sense to offload the rasterization work onto the resource-constrained printer. By 2001, few lower-end printer models came with support for PostScript, largely due to growing competition from much cheaper non-PostScript ink jet printers, and new software-based methods to render PostScript images on the computer, making them suitable for any printer; [[Portable Document Format|PDF]], a similiar to PostScript imaging format, provides one such method, and has largely replaced PostScript as ''[[de facto]]'' standard for electronic document distribution.▼
Apple and Adobe announced the LaserWriter at Apple's annual stockholder meeting on January 23, 1985.<ref name="Pfiffner_Page_47">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=47}}</ref> It was the first printer to ship with PostScript, sparking the [[desktop publishing]] (DTP) revolution in the mid-1980s.<ref name="Pfiffner_Page_48">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=48}}</ref> 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.<ref name="Pfiffner_Page_69">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=69}}</ref> (Apple later renegotiated the contract to pay a licensing fee based on volume of printers shipped.)<ref name="Pfiffner_Page_69" /> The combination of technical merits and widespread availability made PostScript the language of choice for graphical output for printing applications. An [[interpreter (computer software)|interpreter]] (sometimes referred to as a [[Raster Image Processor|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]]s and ample [[computer memory|memory]]. The LaserWriter used a 12 MHz [[Motorola 68000]], making it faster than any of the Macintosh computers to which it was attached.<ref name="Pfiffner_Page_53">{{cite book |last1=Pfiffner |first1=Pamela |title=Inside the Publishing Revolution: The Adobe Story |date=2003 |publisher=Peachpit Press |location=Berkeley |isbn=0-321-11564-3 |page=53}}</ref> When the laser printer engines themselves cost over a thousand dollars the added cost of PS was marginal.
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 ===
Line 65 ⟶ 69:
=== Before PostScript ===
Prior to the introduction of [[Interpress]] and PostScript, printers were designed to print character output given the text—typically in [[ASCII]]—as input.{{citation needed|date=January 2023}} There were a number of technologies for this task, but most shared the property that the [[glyph|glyphs]] were physically difficult to change, as they were stamped onto [[typewriter]] keys, bands of metal, or optical plates.
This changed to some degree with the increasing popularity of [[dot matrix printer]]s. The characters on these systems were drawn as a series of dots, as defined by a [[typeface|font]] 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.
Line 74 ⟶ 78:
=== 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
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 (computer software)|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
=== Font handling ===
Line 94 ⟶ 98:
To compete with Adobe's system, Apple designed their own system, [[TrueType]], around 1991. Immediately following the announcement of TrueType, Adobe published the specification for the Type 1 font format. Retail tools such as Altsys [[Fontographer]] (acquired by [[Macromedia]] 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]] typesetting system are available in this format.
Effective January 2023, support for Type 1 fonts has ended.<ref>{{cite web |title=PostScript Type 1 fonts end of support |url=https://helpx.adobe.com/uk/fonts/kb/postscript-type-1-fonts-end-of-support.html |website=Adobe |publisher=Adobe |access-date=2 March 2024}}</ref>
In the early 1990s there were several other systems for storing outline-based fonts, developed by [[Bitstream Inc.|Bitstream]] and [[Metafont]] for instance, but none included a general-purpose printing solution and they were therefore not widely used.▼
▲In the early 1990s, there were several other systems for storing outline-based fonts, developed by [[Bitstream Inc.|Bitstream]] 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]], 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.
Line 103 ⟶ 109:
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]]. 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<ref>{{Citation | url = http://www.csr.com/products/120/ips-ps3 | title = IPS PS3 | publisher = CSR | url-status = dead | archive-url = https://archive.today/20120724005159/http://www.csr.com/products/120/ips-ps3 | archive-date = 2012-07-24 }}</ref> interpreter, formerly known as PhoenixPage, is standard in many printers and MFPs, including those developed by [[Hewlett-Packard]] and sold under the [[LaserJet]] and Color LaserJet lines. Other third-party PostScript solutions used by print and MFP manufacturers include Jaws<ref>{{Citation | url = http://www.globalgraphics.com/products/jaws-postscript-interpreter/ | title = Jaws | publisher = Global graphics | access-date = 2012-06-13 | archive-date = 2016-03-06 | archive-url = https://web.archive.org/web/20160306074829/http://globalgraphics.com/products/jaws-postscript-interpreter | url-status = dead }}</ref> and the [[Harlequin RIP]], both by [[Global Graphics]]. A [[free software]] version, with several other applications, is [[Ghostscript]]. Several compatible interpreters are listed on the Undocumented Printing Wiki.<ref>{{Citation | url = http://www.undocprint.org/formats/page_description_languages/postscript | publisher = Undocumented Printing | format = wiki | title = Formats | contribution = Page description languages: Postscript | access-date = 2009-12-15 | archive-date = 2017-11-05 | archive-url = https://web.archive.org/web/20171105214328/http://www.undocprint.org/formats/page_description_languages/postscript | url-status = dead }}</ref>
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 Industries|Brother]]'s ''BR-Script3''.
== Use as a display system ==
{{main|Display PostScript|NeWS}}
PostScript became commercially successful due to the introduction of the [[graphical user interface]] (GUI), allowing designers to directly lay out pages for eventual output on laser printers. However, the
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 <code>showpage</code> 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
When [[Steve Jobs]] left Apple and started [[NeXT]], 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 programming language]]. NeXT used these bindings in their [[NeXTStep]] system to provide an [[object oriented]] graphics system. Although DPS was written in conjunction with NeXT, Adobe sold it commercially and it was a common feature of most [[Unix workstation]]s in the 1990s.
Line 120 ⟶ 126:
== Portable Document Format ==
The PDF and PostScript
== The language ==
PostScript is a [[Turing-complete]] programming language, belonging to the [[concatenative programming language|concatenative]] group of programming languages. It is an [[Interpreted language|interpreted]], [[Stack-oriented programming language|stack-based]] language similar to [[Forth (programming language)|Forth]] but with strong dynamic [[Type system|typing]], data structures inspired by those found in [[Lisp (programming language)|Lisp]], [[Scope (computer science)|scoped memory]] and, since language level 2, [[Garbage collection (computer science)|garbage collection]]. The language syntax uses [[reverse 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 (data structure)|stack]] in mind. Most ''operators'' (what other languages term ''functions'') take their arguments from the stack, and place their results onto the stack. ''[[Literal (computer science)|Literal]]s'' (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.▼
PostScript is a [[Turing-complete]] programming language, belonging to the [[concatenative programming language|concatenative]] group. Typically, PostScript programs are not produced by humans, but by other programs. However, it is possible to write computer programs in PostScript just like any other programming language.<ref>[http://www.tinaja.com/post01.shtml PostScript Library]. Don Lancaster's Guru's Lair.</ref>▼
▲PostScript is an [[Interpreted language|interpreted]], [[Stack-oriented programming language|stack-based]] language similar to [[Forth (programming language)|Forth]] but with strong dynamic [[Type system|typing]], data structures inspired by those found in [[Lisp (programming language)|Lisp]], [[Scope (computer science)|scoped memory]] and, since language level 2, [[Garbage collection (computer science)|garbage collection]]. The language syntax uses [[reverse 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 (data structure)|stack]] in mind. Most ''operators'' (what other languages term ''functions'') take their arguments from the stack, and place their results onto the stack. ''[[Literal (computer science)|Literal]]s'' (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 general convention, every PostScript program should start with the characters "%!PS" as an [[interpreter directive]] so that all devices will properly interpret it as PostScript.
▲
=== "Hello world" ===
Line 140 ⟶ 146:
% coordinates 72, 500 (the origin is at the
% lower-left corner of the page)
(Hello world!) show %
showpage % print all on the page
</syntaxhighlight>
Line 161 ⟶ 167:
<syntaxhighlight lang="postscript">
0 0 moveto
0 113.385827
</syntaxhighlight>
Line 168 ⟶ 174:
/cm {72 mul 2.54 div} def % 1 inch = 2.54 cm exactly
0 0 moveto
0 4 cm
</syntaxhighlight>
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.▼
(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,{{citation needed|date=April 2024}} so you might have to use a different starting point to actually see something.)
▲Most implementations of PostScript use [[single-precision]] reals{{citation needed|date=April 2024}} (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 ==
Line 181 ⟶ 190:
== See also ==
* [[Adobe StandardEncoding]] (PostScript character set)
* [[Document Structuring Conventions]]▼
* [[Typeface]]▼
* [[Computer font]]
▲* [[Document Structuring Conventions]]
* [[Encapsulated PostScript]]
* [[PostScript Printer Description]] (PPD)
* [[Printer Command Language]] (PCL)
* [[
==References==
Line 193 ⟶ 202:
==Further reading==
*<!-- <ref name="Adobe_PLRM3"> -->{{cite book |title=PostScript Language Reference Manual |edition=1st printing, 3rd |date=February 1999 |orig-year=1985 |isbn=0-201-37922-8 |author=Adobe Systems Incorporated |author-link=Adobe Systems Incorporated |publisher=[[Addison-Wesley Publishing Company]] |url=https://www.adobe.com/
*<!-- <ref name="Adobe_PLRM2"> -->{{cite book |title=PostScript Language Reference Manual |edition=2nd |date=1990 |orig-year=1985 |author=Adobe Systems Incorporated |author-link=Adobe Systems Incorporated |publisher=[[Addison-Wesley Publishing Company]]}} (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.)<!-- </ref> -->
*<!-- <ref name="Adobe_PLRM1"> -->{{cite book |title=PostScript Language Reference Manual |edition=1st |date=1985 |author=Adobe Systems Incorporated |author-link=Adobe Systems Incorporated |publisher=[[Addison-Wesley Publishing Company]]}} (NB. This edition (''PLR1'') covers PostScript Level 1.)<!-- </ref> -->
Line 201 ⟶ 210:
* {{Citation |url=https://www.adobe.com/print/features/psvspdf/ |publisher=Adobe |title=PostScript vs. PDF |url-status=dead |archive-url=https://web.archive.org/web/20160413212438/https://www.adobe.com/print/features/psvspdf/ |archive-date=2016-04-13 }} (NB. Official introductory comparison of PS, EPS vs. PDF.)
* {{Citation |url=http://www.tailrecursive.org/postscript/postscript.html |title=A First Guide to PostScript |publisher=Tail recursive}}
* {{Cite book |title=Mathematical Illustrations: A Manual of Geometry and PostScript |author-first=William
* {{Cite book |url=http://w3-o.cs.hm.edu/~ruckert/compiler/ThinkingInPostScript.pdf |title=Thinking in PostScript |year=1990 |author-first=Glenn |author-last=Reid |publisher=[[Addison-Wesley]] |place=Colorado, USA}} (NB. A thorough tutorial available online courtesy of the author.)
==External links==
* [https://computerhistory.org/blog/postscript-a-digital-printing-press/ Computer History Museum: article about early development of PostScript]
{{wikibooks|PostScript FAQ}}
Line 214 ⟶ 225:
[[Category:Adobe Inc.]]
[[Category:Computer printing]]
[[Category:
[[Category:Concatenative programming languages]]
[[Category:Digital press]]
|