Location: PHPKode > scripts > APrint > aprint/doc.html
<html>
<head>
<link href="doc.css" rel="stylesheet" type="text/css">
</head>

<body>
<p class="NormalText">Aprint version 1.4
<br>16/02/2005</p>

<h2 class='SectionTitle'>Description</h2>
 <p class='NormalText'>
     Aprint is a small class built to print many text directly from Php at server site.
 </p>
 <p class="NormalText">From version 1.4 it has the module that make Postscript files using 
            the PHP extension 'ps'.</p>
  <p class='NormalText'>
    Feature:
 </p>
 <li class="list">set the page margins</li>
 <li class="list">define many font parameters like font type, size, underline</li>
 <li class="list">use different font type for different row</li>
 <li class="list">automatically start new page when the previous is full</li>
 <li class="list">simple page numbering</li>
 <li class="list">may choose which printer to use</li>
 <li class="list">text alignment, left, center, right (work only with fixed size font)</li>
 
  <p class='NormalText'>
     For more information see the Aprint page at 
	 <a href=www.andrioli.com/en/aprint.html>www.andrioli.com/en/aprint.html</a>
	 (<a href=www.andrioli.com/it/aprint.html>www.andrioli.com/it/aprint.html</a> italian version).
   </p>
<p class='NormalText'>&nbsp;</p>

<h2 class='SectionTitle'>Installation</h2>
 <p class='NormalText'>
     The class require Php 4.3.0 or greater. I had tested this class with that version,
     but I think it should work also with Php 4.2.x.
 </p>
<h2 class='SectionTitle'>Class Aprint Requiremets</h2>
  <p class='NormalText'>
    Any Windows box supported by the php_printer extension (see 'Printer function' in the Php manual)
 </p>
 <p class='NormalText'>
   This class require to add the line extension=php_printer.dll 
   to your php.ini file. 
 </p>
<h2 class="SectionTitle">Class PsPrint Requirements</h2>
 <p class="NormalText">In order to create Postscript file you must get the Postscript extensions
   see 'ps' at <a href= class="SectionTitle">PECL</a> repository, and add it to 
   to your php.ini as extension
 </p>

 <p>&nbsp;</p><h2 class='SectionTitle'>How it works</h2> 
  <p class='NormalText'>
   Here a quick example how to use Aprint. 
 </p>
 
  <span class='CodeComment'>Create a new istance of the 
  class and initialize it</span><br>
  <span class="CodeText"> $p=new aprint(); </span> <br>
  <span class='CodeComment'>Set the document title</span><br>
  <span class="CodeText">$p->Title("test_1");</span><br>
  <span class="CodeComment">Write some text using the standard font</span><br>
  <span class="CodeText">$p->Text("Left text");</span><br>
  <span class="CodeComment">Printout the text</span><br>
  <span class="CodeText">$p->run();</span><br>
  <p class="NormalText">That's all!</p>
  <p class="NormalText">Now a more complete example</p>
  
<p class="CodeComment"><span class="CodeText"> $p=new aprint(); </span> <br>
  <span class='CodeComment'>Set the top and left margins. -1 means ignore this 
  parameter</span><br>
  <span class="CodeText">$p->SetMargin(2880,-1,1200);</span><br>
  <span class="CodeText">$p->Title("test_1");</span><br>
  <span class="CodeText">$p->Text("Left text");</span><br>
  <span class="CodeComment">Now write a centered text</span><br>
  <span class="CodeText">$p->Text("Center text",-1,AP_CENTER);</span><br>
  <span class="CodeComment">Define a new font</span><br>
  <span class="CodeText">$fnt=$p->CreateFont("Arial");</span><br>
  <span class="CodeComment">Write some text using the new font</span><br>
  <span class="CodeText">$p->Text("Arial text",$fnt);</span><br>
  <span class="CodeText">$p->run();</span><br>
</p>
<h2 class='SectionTitle'>Predefined settings</h2>
<table>
  <tr>
    <td rowspan="4"><p class='grouptitle'>Margins</p></td>
	<td><p class='BoldText'>Top margin</p></td>
    <td><p class='NormalText'>400</p></td>
  </tr>
    <tr>
	<td><p class='BoldText'>Bottom margin</p></td>
    <td><p class='NormalText'>400</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Left margin</p></td>
    <td><p class='NormalText'>40</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Right margin</p></td>
    <td><p class='NormalText'>40</p></td>
  </tr>
  <tr>
    <td rowspan="7"><p class='grouptitle'>Normal font</p></td>
	<td><p class='BoldText'>Font name</p></td>
    <td><p class='NormalText'>Courier new</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Height</p></td>
    <td><p class='NormalText'>336</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Width</p></td>
    <td><p class='NormalText'>168</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Font_weight</p></td>
    <td><p class='NormalText'>400</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Italic</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Underline</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Strikeout</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
    <td rowspan="7"><p class='grouptitle'>Bold font</p></td>
	<td><p class='BoldText'>Font name</p></td>
    <td><p class='NormalText'>Courier new</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Height</p></td>
    <td><p class='NormalText'>336</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Width</p></td>
    <td><p class='NormalText'>168</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Font_weight</p></td>
    <td><p class='NormalText'>800</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Italic</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Underline</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Strikeout</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
    <td rowspan="7"><p class='grouptitle'>Footer font</p></td>
	<td><p class='BoldText'>Font name</p></td>
    <td><p class='NormalText'>Courier new</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Height</p></td>
    <td><p class='NormalText'>163</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Width</p></td>
    <td><p class='NormalText'>50</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Font_weight</p></td>
    <td><p class='NormalText'>200</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Italic</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Underline</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>Strikeout</p></td>
    <td><p class='NormalText'>no</p></td>
  </tr>
</table>

<h2 class='SectionTitle'>Change Log</h2>
<table border=0>
<tr> 
 <td style='vertical-align:top'>
  <p class="NormalText">16/02/2005 ver 1.4 
  </p>
 </td>
 <td>
  <p class="NormalText">
   <li>
    Added new class to create PostScript file.
   </li> 
   <li>
    Built new api documentation 
   </li>       
  </p>
 </td>
</tr>  
<tr>
<td style='vertical-align:top'><p class="NormalText">29/02/2004 ver 1.3 </p></td>
<td>
<p class="NormalText">
   <li>Added, new functions, TextXY (print the text at the given position),
       AutoNewPage (you may disable the automatic page skip).</li>
   <li>Fixed, again some problem about the right alignment.</li>
   <li>Fixed, don't skip to the new page if pagefooter is not set.</li>
</p>
</td>
</tr>
<tr>
<td style='vertical-align:top'><p class="NormalText">05/12/2003 ver 1.2 </p></td>
<td>

<p class="NormalText">
   <li>You may add an header repeated on each page.</li>
   <li>Fix right alignment.</li>
</p>
</td>
</tr>
<tr>
<td style='vertical-align:top'><p class="NormalText">27/09/2003 ver 1.1 </p></td>
<td>
<p class="NormalText">
   <li>Added move function.</li>
   <li>Added callback, you my call custom function each time 
       the module change the page.</li>

</p>
</td>
</tr>
<tr><td style='vertical-align:top'>
<p class="NormalText" >28/05/2003 ver 1.0</p>
</td><td><p class="NormalText">First public release</td></tr>
</table>
<h2 class='SectionTitle'>Known limit</h2>
<p class="NormalText">The alignment, AP_CENTER, AP_RIGHT work only with fixed size font like Courier New.</p>

<h2 class='SectionTitle'>License</h2>
<p class="NormalText">Aprint is licensed under the GNU/LGPL.  See license.txt.</p>

<p class="NormalText">That's all. I hope it be useful.<br>
Darvin<br>
(darvin at andrioli dot com)</p>
</body>
</html>
Return current item: APrint