PDF: Difference between revisions

[accepted revision][accepted revision]
Content deleted Content added
→‎PostScript language: Adding citations
→‎PostScript language: Changing my mind, removing cites from paragraph, only one of those three sentences is directly supported by source
Line 78:
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 as a [[Raster graphics|raster image]] to a printing device.<ref name="Pfiffner_Page_139">{{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=139}}</ref> PostScript was not intended for long-term storage and real-time interactive rendering of [[electronic document]]s to [[computer monitor]]s, so there was no need to support anything other than consecutive rendering of pages.<ref name="Pfiffner_Page_139" /> If there was an error in the final printed output, the user would correct it at the application level and send a new print job in the form of an entirely new PostScript file. Thus, any given page in a PostScript file could be accurately rendered only as the cumulative result of executing all preceding commands to draw all previous pages—any of which could affect subsequent pages—plus the commands to draw that particular page, and there was no easy way to bypass that process to skip around to different pages.<ref name="Pfiffner_Page_139" />
 
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.<ref name="Pfiffner_Page_139" /> 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.<ref name="Pfiffner_Page_139" /> 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]].<ref name="Pfiffner_Page_139" />
 
As a document format, PDF has several advantages over PostScript: