<!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_PRINTER</title> <link rel="stylesheet" type="text/css" href="../../style.css"> </head> <body> <h2>CD_PRINTER - Printer Driver (cdprint.h)</h2> <p>This driver provides access to a System Default Printer. </p> <p>Currently, it works only in Microsoft Windows platforms, but it is possible to use it in other platforms without the risk of compilation error. If you attempt to create a canvas in another platform, the function <a href="../func/init.html#cdCreateCanvas"> <font face="Courier"><strong>cdCreateCanvas</strong></font></a> will return NULL.</p> <h3>Use</h3> <p>The canvas is created by calling function <font face="Courier"> <a href="../func/init.html#cdCreateCanvas"> <strong>cdCreateCanvas</strong></a>(CD_PRINTER, Data)</font>, after which other CD functions can be called as usual. The <font face="Courier">Data</font> string has the following format:</p> <pre><span style="background-color: #CEE7FF">"</span><i>name </i>[-d]" <em> or in C style "</em><em><strong><tt>%s -d</tt></strong></em><em>"</em></pre> <p><font face="Courier">name</font> is an optional document name that will appear in the printer queue. Optionally, <font face="Courier">-d</font> displays the System Printer dialogue box before starting to print, allowing you to configure the printer's parameters. When using this parameter and the return canvas is NULL, one must assume that the print was canceled by the user.</p> <p>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 properly send the data to the printer.</p> <p><b>Pages -</b> Use <a href="../func/control.html#cdFlush"> <font face="Courier"><strong>Flush</strong></font></a> to change to a new page. You can draw first on page 1, then on page 2 and so forth.</p> <p>To use this driver in Windows using GDI+ is necessary to call <font face="Courier"><strong> cdUseContextPlus</strong></font><strong><font face="Courier">(1)</font></strong> before creating the canvas.</p> <h3>Behavior of Functions</h3> <p>This driver is greatly platform-dependent. For further detail, see the <b> Behavior of Functions</b> in each platform: <a href="win32.html">Microsoft Windows (GDI)</a>, <a href="gdiplus.html">Windows Using GDI+</a>, <a href="xwin.html">X-Windows (XLIB)</a>. However, it should be noted that some functions behave differently from the basic functions of each platform.</p> <p>A printer created in Win32s has the same limitations as the <a href="wmf.html">WMF driver</a>. In Windows 95 or NT, it has the same limitations as the <a href="emf.html">EMF driver</a>.</p> <h4>Control</h4> <ul> <li> <a href="../func/control.html#cdFlush"> <font face="Courier"><strong>Flush</strong></font></a>: changes to a new page, preserving the previous one. In the Win32 base driver, after the first page, function <font face="Courier"><strong>cdText</strong></font> draws the text below its correct position - we do not know why this happens.</li> </ul> <h4>Attributes </h4> <ul> <li> <a href="../func/filled.html#cdHatch"> <font face="Courier"><strong>Hatch</strong></font></a>: opaque in Win32 base driver (GDI).</li> </ul> </body> </html>