]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/spec-postscript.html
Load cups into easysw/current.
[thirdparty/cups.git] / doc / help / spec-postscript.html
CommitLineData
f7deaa1a 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
2<html>
3<!-- SECTION: Specifications -->
4<head>
5 <title>Generating PostScript for CUPS</title>
6 <meta name='keywords' content='Programming, PostScript, Document Structuring Conventions'>
7 <link rel='stylesheet' type='text/css' href='../cups.css'>
8</head>
9<body>
10<!--
11 "$Id$"
12
13 CUPS PostScript file specification for the Common UNIX Printing System (CUPS).
14
15 Copyright 2006 by Easy Software Products.
16
17 These coded instructions, statements, and computer programs are the
18 property of Easy Software Products and are protected by Federal
19 copyright law. Distribution and use rights are outlined in the file
20 "LICENSE.txt" which should have been included with this file. If this
21 file is missing or damaged please contact Easy Software Products
22 at:
23
24 Attn: CUPS Licensing Information
25 Easy Software Products
26 44141 Airport View Drive, Suite 204
27 Hollywood, Maryland 20636 USA
28
29 Voice: (301) 373-9600
30 EMail: cups-info@cups.org
31 WWW: http://www.cups.org
32-->
33
34<h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
35
36<p>This document describes how to generate PostScript output for
37CUPS and is largely based on the <a
38href="http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf">
39Adobe TechNote #5001: PostScript Language Document Structuring
40Conventions Specification Version 3.0</a>. While CUPS can
41generally print any PostScript file, following the rules in the
42Adobe TechNote and this document will ensure that your PostScript
43output will work reliably.</p>
44
45<blockquote><b>Note:</b> While PostScript is currently the
46defacto-standard print job file format/language for UNIX-based
47applications, it is slowly being phased out in favor of Adobe's
48Portable Document Format ("PDF") which offers many advantages
49over PostScript. MacOS X uses PDF as the primary print job file
50format, and we expect Linux to soon follow. Both PostScript and
51PDF are complex formats, and we highly recommend using high-level
52toolkits whenever possible.</blockquote>
53
54<h3>Anatomy of a PostScript File</h3>
55
56<p>PostScript files are ASCII text files starting with a header
57line (<tt>%!PS-Adobe-3.0</tt>) followed by a combination of
58comment lines starting with two percent signs (<tt>%%</tt>) and
59PostScript code lines. The lines themselves should not exceed 255
60characters to conform to the DSC. The following short PostScript
61file produces a box with a smiley face in it:</p>
62
63<pre class="command">
64%!PS-Adobe-3.0
65%%BoundingBox: 36 36 576 756
66%%Pages: 1
67%%LanguageLevel: 2
68%%EndComments
69%%Page: (1) 1
70% Draw a black box around the page
710 setgray
721 setlinewidth
7336 36 540 720 rectstroke
74
75% Draw a two inch blue circle in the middle of the page
760 0 1 setrgbcolor
77306 396 144 0 360 arc closepath fill
78
79% Draw two half inch yellow circles for eyes
801 1 0 setrgbcolor
81252 432 36 0 360 arc closepath fill
82360 432 36 0 360 arc closepath fill
83
84% Draw the smile
851 setlinecap
8618 setlinewidth
87306 396 99 200 340 arc stroke
88
89% Print it!
90showpage
91%%EOF
92</pre>
93
94<div class="figure"><table summary="Sample PostScript File Output">
95<caption>Figure 1: <a name="FIGURE_1">Sample PostScript File Output</a></caption>
96<tr><td align="center"><img src="../images/smiley.jpg"
97width="445" height="570" alt="Sample PostScript File Output"></td></tr>
98</table></div>
99
100
101<h2>Embedding Printer Options</h2>
102
103
104<h2>Embedding Fonts and Text</h2>
105
106
107<h2>Embedding Images</h2>
108
109
110<blockquote><b>Note:</b> While some printers support arbitrary
111binary data in PostScript files, we do not recommend this
112practice because it does not work with all printers or
113interfaces. In most cases, the Base-85 encoding and compression
114filters can be used to embed images with very little, if any,
115increase in data size.</blockquote>
116
117
118
119</body>
120</html>