summaryrefslogtreecommitdiff
path: root/html/en/drv/ps.html
diff options
context:
space:
mode:
authorscuri <scuri>2008-10-17 06:10:33 +0000
committerscuri <scuri>2008-10-17 06:10:33 +0000
commit7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf (patch)
treed0857278bde2eff784227c57dcaf930346ceb7ac /html/en/drv/ps.html
First commit - moving from LuaForge to SourceForge
Diffstat (limited to 'html/en/drv/ps.html')
-rw-r--r--html/en/drv/ps.html208
1 files changed, 208 insertions, 0 deletions
diff --git a/html/en/drv/ps.html b/html/en/drv/ps.html
new file mode 100644
index 0000000..7a2dc1a
--- /dev/null
+++ b/html/en/drv/ps.html
@@ -0,0 +1,208 @@
+<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+
+<head>
+<meta http-equiv="Content-Language" content="en-us">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>CD_PS</title>
+<link rel="stylesheet" type="text/css" href="../../style.css">
+</head>
+
+<body>
+
+<h2>CD_PS - PostScript Driver (cdps.h)</h2>
+
+ <p>This drivers allows generating a PostScript file. This format was created to be a high-quality graphics language
+ for printers and is currently supported by several printers. If your printer supports PostScript, you can send the
+ file generated by the driver directly to the printer port. Usually, the filename has an extension .PS or .EPS. The
+ driver generates level-2 PostScript, therefore some PostScript viewers might present errors. The format's copyrights
+ are property of <a href="http://www.adobe.com" target="_top">Adobe Systems</a>. </p>
+
+<h3>Use</h3>
+
+ <p>The file is created and opened by calling function <font face="Courier">
+ <a href="../func/init.html#cdCreateCanvas"><strong>cdCreateCanvas</strong></a>(CD_PS,
+ Data)</font>, in which <font face="Courier">Data</font> contains the filename and canvas dimensions. This function
+ opens the file and writes its header. Then, other functions in the CD library can be called as usual. The
+ <font face="Courier">Data</font> parameter string has the following format:</p>
+
+ <pre>&quot;<em>filename -p[paper] -w[width] -h[height] -l[left] -r[right] -b[bottom] -t[top] -s[resolution] [-e]</em> <em>[-g] [-o] [-1] d[margin]</em>&quot;<em><br>
+</em>or in C<em><br>
+&quot;<strong><tt>%s -p%d -w%g -h%g -l%g -r%g -b%g -t%g -s%d -e -o -1 -g -d%g</tt></strong>&quot;</em></pre>
+
+ <p>The filename must be inside double quotes (&quot;) if it has spaces. Any amount of such canvases may exist
+ simultaneously. It is important to note that a call to function
+ <a href="../func/init.html#cdKillCanvas"><font face="Courier"><strong>
+ cdKillCanvas</strong></font></a> is required to <b>close</b> the file properly.</p>
+ <p><b>Paper Size - </b>The default paper size is A4. It is possible to change it by using one of the predefined sizes
+ - <strong><tt>CD_A0</tt></strong>, <strong><tt>CD_A1</tt></strong>, <strong><tt>CD_A2</tt></strong>, <strong><tt>CD_A3</tt></strong>,
+ <strong><tt>CD_A4</tt></strong>, <strong><tt>CD_A5</tt></strong>, <strong><tt>CD_LETTER</tt></strong> and <strong><tt>
+ CD_LEGAL</tt></strong> - with parameter &quot;<font face="Courier">-p</font>&quot;. It is also possible to define a paper in a
+ particular size by using parameters &quot;<font face="Courier">-w</font>&quot; e &quot;<font face="Courier">-h</font>&quot;. Values are
+ provided in millimeters.</p>
+
+<div align="center">
+ <center>
+ <table border="1" cellpadding="3">
+ <caption valign="top"><font size="4">Default Paper Sizes</font></caption>
+ <tr>
+ <td>&nbsp;</td>
+ <th>Width (mm)</th>
+ <th>Length (mm)</th>
+ </tr>
+ <tr>
+ <td><strong>A0</strong></td>
+ <td align="center">841</td>
+ <td align="center">1187</td>
+ </tr>
+ <tr>
+ <td><strong>A1</strong></td>
+ <td align="center">594</td>
+ <td align="center">841</td>
+ </tr>
+ <tr>
+ <td><strong>A2</strong></td>
+ <td align="center">420</td>
+ <td align="center">594</td>
+ </tr>
+ <tr>
+ <td><strong>A3</strong></td>
+ <td align="center">297</td>
+ <td align="center">420</td>
+ </tr>
+ <tr>
+ <td><strong>A4</strong></td>
+ <td align="center">210</td>
+ <td align="center">297</td>
+ </tr>
+ <tr>
+ <td><strong>A5</strong></td>
+ <td align="center">148</td>
+ <td align="center">210</td>
+ </tr>
+ <tr>
+ <td><strong>Letter</strong></td>
+ <td align="center">216</td>
+ <td align="center">279</td>
+ </tr>
+ <tr>
+ <td><strong>Legal</strong></td>
+ <td align="center">216</td>
+ <td align="center">356</td>
+ </tr>
+ </table>
+ </center>
+</div>
+
+ <p><b>Margins -</b> The margins are controlled by parameters &quot;<font face="Courier">-l</font>&quot; &quot;<font face="Courier">-r</font>&quot;
+ &quot;<font face="Courier">-t</font>&quot; and &quot;<font face="Courier">-b</font>&quot; (<em>left, right, top, bottom</em>). Values are
+ provided in millimeters. Default margins are 25.4 mm to all parameters. You can draw only inside the margins.</p>
+ <p><b>Resolution -</b> Resolution is used to convert values from millimeters to pixels (the same as points, but the
+ number of points is per inch - DPI). Use parameter &quot;<font face="Courier">-s</font>&quot; to configure the resolution. The
+ default value is 300 DPI.</p>
+ <p><b>Orientation -</b> The page can be oriented as portrait or landscape. The default value is portrait, but when the
+ parameter &quot;-o&quot; is used, the horizontal and vertical values are switched.</p>
+ <p><b>EPS -</b> The PostScript file can be in an <strong>Encapsulated PostScript<b> </b></strong>format. For such,
+ simply specify the parameter &quot;<font face="Courier">-e</font>&quot;. It is useful for other applications to import the
+ PostScript file. You can define the margins of the bounding box by means of parameter &quot;<font face="Courier">-d</font>&quot;,
+ in millimeters.</p>
+ <p><b>Debug -</b> Parameter &quot;<font face="Courier">-g</font>&quot; adds a series of comments to the PS file, making the
+ beginning and end of a command from the CD library explicit. It is useful only for those who understand PostScript and
+ wish to identify a problem. It considerably increases the file size.</p>
+ <p><b>Level 1 -</b> Parameter &quot;<font face="Courier">-1</font>&quot; forces the driver to generate a level-1 PostScript. In
+ this case, pattern, stipple and hatch are not supported.</p>
+ <p><b>Pages -</b> Use function <font face="Courier">cdFlush</font> to change to a new page. The previous page will not
+ be changed.</p>
+
+<h3>Behavior of Functions</h3>
+<h4>Control</h4>
+<ul>
+ <li><a href="../func/other.html#cdPlay"><font face="Courier"><strong>Play</strong></font></a>:
+ does nothing, returns <font face="Courier">CD_ERROR</font>. </li>
+ <li><a href="../func/control.html#cdFlush"><font face="Courier"><strong>Flush</strong></font></a>:
+ changes to a new page, preserving the previous one. Does nothing in EPS mode.</li>
+ <li><a href="../func/control.html#cdClear"><font face="Courier"><strong>Clear</strong></font></a>:
+ does nothing.</li>
+</ul>
+<h4>Coordinate System&nbsp;&amp; Clipping</h4>
+<ul>
+ <li><a href="../func/coordinates.html#cdGetCanvasSize"><font face="Courier">
+ <strong>GetCanvasSize</strong></font></a>: returns the page's size within the margins (drawing area).</li>
+ <li><a href="../func/coordinates.html#cdUpdateYAxis"><font face="Courier">
+ <strong>UpdateYAxis</strong></font></a>: does nothing.</li>
+ <li><b>Complex Regions</b>: not supported.</li>
+</ul>
+<h4>Attributes</h4>
+<ul>
+ <li><a href="../func/attributes.html#cdBackground"><font face="Courier">
+ <strong>
+ Background</strong></font></a> does nothing, returns <font face="Courier">CD_WHITE</font>.</li>
+ <li><a href="../func/filled.html#cdBackOpacity"><font face="Courier"><strong>
+ BackOpacity</strong></font></a>: does nothing, returns <font face="Courier">CD_TRANSPARENT</font>.</li>
+ <li><a href="../func/attributes.html#cdWriteMode"><font face="Courier">
+ <strong>
+ WriteMode</strong></font></a>: does nothing, returns <font face="Courier">CD_REPLACE</font>.</li>
+ <li><a href="../func/text.html#cdFontDim"><font face="Courier"><strong>FontDim</strong></font></a>:
+ is simulated.</li>
+ <li><a href="../func/text.html#cdTextSize"><font face="Courier"><strong>
+ TextSize</strong></font></a>: is simulated.</li>
+ <li><a href="../func/filled.html#cdHatch"><font face="Courier"><strong>Hatch</strong></font></a>:
+ is always opaque (to be implemented).</li>
+ <li><a href="../func/filled.html#cdStipple"><font face="Courier"><strong>
+ Stipple</strong></font></a>: is always opaque (to be implemented).</li>
+ <li><a href="../func/text.html#cdTextAlignment"><font face="Courier"><strong>
+ TextAlignment</strong></font></a>: <font face="Courier">Baseline</font> is the same as <font face="Courier">South</font>.</li>
+ <li><a href="../func/text.html#cdFont"><font face="Courier"><strong>Font</strong></font></a>:
+ old name &quot;System&quot; is mapped to &quot;Courier&quot;. Styles are added to the Postscript
+ font name.</li>
+</ul>
+<h4>Colors </h4>
+<ul>
+ <li><a href="../func/color.html#cdGetColorPlanes"><font face="Courier">
+ <strong>
+ GetColorPlanes</strong></font></a>: returns 24.</li>
+ <li><a href="../func/color.html#cdPalette"><font face="Courier"><strong>Palette</strong></font></a>:
+ does nothing. </li>
+</ul>
+<h4>Client Images</h4>
+<ul>
+ <li><a href="../func/client.html#cdGetImageRGB"><font face="Courier"><strong>
+ GetImageRGB</strong></font></a>: does nothing.</li>
+ <li><font face="Courier"><strong><a href="../func/client.html#cdPutImageMap">
+ PutImageMap</a></strong></font>: stores an RGB image in the file (to be implemented).</li>
+ <li><a href="../func/client.html#cdPutImageRGBA"><font face="Courier"><strong>
+ PutImageRGBA</strong></font></a>: alpha is ignored (to be implemented).</li>
+</ul>
+<h4>Primitives</h4>
+<ul>
+ <li><font face="Courier"><strong><a href="../func/marks.html#cdPixel">Pixel</a></strong></font>:
+ does not exist in PS, is simulated using a circle with radius=1.</li>
+ <li>Floating point primitives are supported.</li>
+ <li>Filled primitves do not include the line at the edges of the filled area.</li>
+</ul>
+<h4>Server Images</h4>
+<ul>
+ <li>All functions do nothing.</li>
+</ul>
+<h4>Exclusive Attributes</h4>
+<ul>
+ <li>&quot;<strong><font face="Courier">POLYHOLE</font></strong>&quot;: defines the index of
+ the vertex where there is a hole in a
+ closed polygon. It will affect the next <strong>cdEnd</strong>. Can be called several times between
+ <strong>cdBegin</strong> and <strong>cdEnd</strong> to define holes. The value passed must
+ be a string containing an integer (&quot;%d&quot;). If the value of the attribute passed is NULL, all holes will no longer be
+ considered.&nbsp;When consulted returns the current number of holes (&quot;%d&quot;). It can have a maximum of 500 holes.</li>
+</ul>
+<ul>
+ <li>&quot;<b><font face="Courier">CMD</font></b>&quot;: saves a string directly to the file. Allows adding PostScript commands
+ to the file generated by the CD library. (set only)</li>
+</ul>
+<ul>
+ <li>&quot;<b><font face="Courier">ROTATE</font></b>&quot;:&nbsp; allows the usage of 1 angle and 1 coordinate (x, y), that
+ define a global rotation transformation centered in the specified coordinate. Use 1 real and 2 integer values inside a
+ string (&quot;%g %d %d&quot; = angle x y).</li>
+</ul>
+
+</body>
+
+</html>