PDF: Difference between revisions

[accepted revision][accepted revision]
Content deleted Content added
Line 74:
 
=== PostScript language ===
[[PostScript]] is a [[page description language]] run in an [[Interpreter (computing)|interpreter]] to generate an image. It can handle graphics and has standard features of [[programming language]]s such as [[conditional (computer programming)|branching]] and [[loop (computing)|looping]]. PDF is a subset of PostScript, simplified to remove such flow [[control flow]] features, while graphics commands remain.
 
PostScript was originally designed for a drastically different [[use case]]: transmission of one-way linear [[print job]]s in which the PostScript interpreter would collect a series of commands until it encountered the <code>showpage</code> command, then execute all the commands to render a page to a printing device. PostScript was not intended for long-term storage and real-time interactive rendering of [[electronic document]]s, so there was no need to support scrolling back to previous pages. To accurately renderThus, any given page, itin wasa necessaryPostScript file could be rendered only as the cumulative result of executing all preceding commands to executedraw all previous pages, plus the commands to draw that particular page, and renderthere allwas theno precedingeasy pages.way to bypass that process to skip around to different pages.
 
Traditionally, to go from PostScript to PDF, a source PostScript file (that is, an executable program) is used as the basis for generating PostScript-like PDF code. This is done by applying standard [[compiler]] techniques like [[loop unrolling]], [[inline expansion|inlining]] and removing unused branches, resulting in code that is purely declarative and static. The end result is then packaged into a [[container format]], together with all necessary [[Dependency (computer science)|dependencies]] for correct rendering (external files, graphics, or fonts to which the document refers), and [[Data compression|compressed]].