Aprint version 1.5
10/03/2008
Aprint is a small class built to print many text directly from Php at server site.
From version 1.4 it has the module that make Postscript files using the PHP extension 'ps'.
Feature:
For more information see the Aprint page at www.andrioli.com/en/aprint.html (www.andrioli.com/it/aprint.html italian version).
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. As version 1.5, the class is tested on PHP 5.2.x system. So far I haven't any notice about the support for 'ps' module on PHP 5.
Any Windows box supported by the php_printer extension (see 'Printer function' in the Php manual)
This class require to add the line extension=php_printer.dll to your php.ini file.
In order to create Postscript file you must get the Postscript extensions see 'ps' at PECL repository, and add it to to your php.ini as extension
Here a quick example how to use Aprint.
Create a new istance of the class and initialize itThat's all!
Now a more complete example
$p=new aprint();
Set the top and left margins. -1 means ignore this
parameter
$p->SetMargin(2880,-1,1200);
$p->Title("test_1");
$p->Text("Left text");
Now write a centered text
$p->Text("Center text",-1,AP_CENTER);
Define a new font
$fnt=$p->CreateFont("Arial");
Write some text using the new font
$p->Text("Arial text",$fnt);
$p->run();
Margins |
Top margin |
400 |
Bottom margin |
400 |
|
Left margin |
40 |
|
Right margin |
40 |
|
Normal font |
Font name |
Courier new |
Height |
336 |
|
Width |
168 |
|
Font_weight |
400 |
|
Italic |
no |
|
Underline |
no |
|
Strikeout |
no |
|
Bold font |
Font name |
Courier new |
Height |
336 |
|
Width |
168 |
|
Font_weight |
800 |
|
Italic |
no |
|
Underline |
no |
|
Strikeout |
no |
|
Footer font |
Font name |
Courier new |
Height |
163 |
|
Width |
50 |
|
Font_weight |
200 |
|
Italic |
no |
|
Underline |
no |
|
Strikeout |
no |
10/03/2008 ver 1.5 |
|
16/02/2005 ver 1.4 |
|
29/02/2004 ver 1.3 |
|
05/12/2003 ver 1.2 |
|
27/09/2003 ver 1.1 |
|
28/05/2003 ver 1.0 | First public release |
The alignment, AP_CENTER, AP_RIGHT work only with fixed size font like Courier New.
Aprint is licensed under the GNU/LGPL. See license.txt.
That's all. I hope it be useful.
Darvin
(darvin at andrioli dot com)