APrint APrint(
[string
$TitleText = ""], [string
$ScriptId = ""]
)
|
|
Initialize this class. It doesn not attempt to
establish the connection to the printer This class will perform this job at the first time that you send any text
Parameters:
string |
$TitleText: |
document title |
string |
$ScriptId: |
script identification |
API Tags:
Skip a row, left a blank row.
API Tags:
integer Conv2Twip_x(
integer
$value
)
|
|
Convert the printer point size into internal point size according to its resolution
As internal unit I use the twip. 1 inch = 1440 twip, 1 mm = 56,7 twip
Parameters:
API Tags:
integer Conv2Twip_y(
integer
$value
)
|
|
Parameters:
API Tags:
void CreateFont(
[string
$fName = "Courier new"], [integer
$fHeight = 336], [integer
$fWidth = 168], [integer
$fWeight = 400], [boolean
$fItalic = false], [boolean
$fUnderline = false], [boolean
$fStrikeout = false], [mixed
$fOrientaton = 0], integer
$fOrientation
)
|
|
Create a new font
Parameters:
string |
$fName: |
Font Name, default: Courier New |
integer |
$fHeight: |
Font height, default: 336 |
integer |
$fWidth: |
Font width, default: 168 |
integer |
$fWeight: |
Font weight, default: 400. 0 -> thin, 800 -> bold |
boolean |
$fItalic: |
Italic script? True/False |
boolean |
$fUnderline: |
Text with underline? True/False |
boolean |
$fStrikeout: |
True/False |
integer |
$fOrientation: |
Should be always 3 digits, i.e 020. See printer_create_font in the note to the manual |
API Tags:
Redefined in descendants as:
Retrieve the page size
API Tags:
Return: | (width,length) |
Access: | public |
void HeaderText(
string
$TitleText, [integer
$hFont = -1]
)
|
|
Write an header at the top of the first page.
Parameters:
integer |
$hFont: |
font handle returned by CreateFont |
string |
$TitleText: |
Text to print |
API Tags:
See: | CreateFont(); |
Access: | public |
Draw a dash line.
API Tags:
boolean MvAbsolutePos(
integer
$nUnit, [string
$unit = 'row']
)
|
|
Move the currentline to nRow. It return TRUE on success,
FALSE otherwise
Parameters:
integer |
$nUnit: |
Numebr of 'unit' it must be greater then zero |
string |
$unit: |
measurement used to set the movement |
API Tags:
boolean MvBottom(
integer
$nRow
)
|
|
Move to the last row before the bottom margin It return TRUE on success, FALSE otherwise.
Notice: the bottom is calculated using as row hight the current font
Parameters:
integer |
$nRow: |
New current line number |
API Tags:
boolean MvRelativePos(
integer
$nUnit, [string
$unit = 'row']
)
|
|
Move the currentline up or down of nRow rows. It return TRUE on success,
FALSE otherwise
Parameters:
integer |
$nUnit: |
Numebr of 'unit' may be less or greater then zero |
string |
$unit: |
measurement used to set the movement |
API Tags:
Move to the first row after the top margin It return TRUE on success,
FALSE otherwise
API Tags:
Close the current page and start a new one.
API Tags:
Redefined in descendants as:
void OpenPrinter(
[string
$PrinterName = ""]
)
|
|
Start the connection to the printer. This is the public interface to _OpenPrinter.
Parameters:
string |
$PrinterName: |
Name of the printer to use. If not set use the system default |
API Tags:
Print the page header
API Tags:
Redefined in descendants as:
integer ResConv_x(
integer
$value
)
|
|
Convert the internal point size to the printer point size according to its resolution
As internal unit I use the twip. 1 inch = 1440 twip, 1 mm = 56,7 twip
Parameters:
API Tags:
integer ResConv_y(
integer
$value
)
|
|
Parameters:
API Tags:
Close the output to the printer and start to print
API Tags:
Redefined in descendants as:
boolean SetAutoNewPage(
boolean
$bool
)
|
|
Set the AutoNewPage flag. If set to true, the module call the functionNewPage
automatically at the end of the page, if set to off, the user must call the NewPage function
Parameters:
API Tags:
void SetBottomMargin(
integer
$value
)
|
|
Set the size for the bottom margin
Parameters:
API Tags:
void SetCallBack(
string
$callback, mixed
$func, array
$parm
)
|
|
Set the callback function
Parameters:
string |
$callback: |
which callback apply the function |
mixed |
$func: |
function name or array holding object and method (see call_uzer_func_array manual page for more detail) |
array |
$parm: |
parameters to pass to the function |
API Tags:
void SetLeftMargin(
integer
$value
)
|
|
Set the size for the left margin
Parameters:
API Tags:
void SetMargin(
integer
$top, [integer
$bottom = -1], [integer
$left = -1], [integer
$right = -1]
)
|
|
Useful function to setup all margins with one function use -1 to skip the parameter
Parameters:
integer |
$top: |
top margin size |
integer |
$bottom: |
bottom margin size |
integer |
$left: |
left margiclass |
integer |
$right: |
right margin size |
API Tags:
Redefined in descendants as:
-
PSPrint::SetMargin()
: Useful function to setup all margins with one function use -1 to skip the parameter
void SetPageHeader(
mixed
$Text, [mixed
$fontArray = array()], [mixed
$OnFirstPage = true]
)
|
|
Setup the text to print on each page.
The text, passed as array, allow you to pass many rows ( 1 row = 1 item).
API Tags:
void SetPrinter(
string
$Name
)
|
|
Specifiy which printer I'll use. If you don't give any printer, the default printer will be used.
Parameters:
string |
$Name: |
printer name as defined in Window |
API Tags:
Redefined in descendants as:
-
PSPrint::SetPrinter()
: Specify which printer I'll use. PSPrint does not use any printer, but write its content into file, therefore this function is meaningless. Call SetFileName instead. It exists to avoid to broke the interface.
void SetPrintFooter(
bool
$print
)
|
|
Set if the module should print its own footer or not.
Parameters:
bool |
$print: |
TRUE=print its own page footer |
API Tags:
void SetRightMargin(
integer
$value
)
|
|
Set the size for the right margin
Parameters:
API Tags:
void SetTopMargin(
integer
$value
)
|
|
Set the size for the top margin
Parameters:
API Tags:
Redefined in descendants as:
void Text(
string
$text, [integer
$hFont = -1], [integer
$align = AP_LEFT], [integer
$col = 0]
)
|
|
printout the text
Parameters:
string |
$text: |
text to printout |
integer |
$hFont: |
Handle to the font to use. Handle returned by CreateFont |
integer |
$align: |
text alignment |
integer |
$col: |
Orizontal position where start to print the text. This value will be added to the left margin. |
API Tags:
Redefined in descendants as:
void TextFooter(
string
$text, [integer
$hFont = -1], [integer
$align = AP_LEFT], [integer
$col = 0]
)
|
|
Print the given text as page footer
Parameters:
string |
$text: |
text to printout |
integer |
$hFont: |
Handle to the font to use. Handle returned by CreateFont |
integer |
$align: |
text alignment |
integer |
$col: |
Orizontal position where start to print the text. This value will be added to the left margin. |
API Tags:
Redefined in descendants as:
void TextXY(
integer
$Xpos, integer
$Ypos, string
$text, [integer
$hFont = -1]
)
|
|
printout the text at the exact position requested
Parameters:
string |
$text: |
text to printout |
integer |
$hFont: |
Handle to the font to use. Handle returned by CreateFont |
integer |
$Xpos: |
orizontal position |
integer |
$Ypos: |
vertical position where print the text |
API Tags:
Redefined in descendants as:
void _BeginCol(
integer
$align, integer
$textWidth, integer
$col
)
|
|
This function compute the starting position given the
text alignment, the left margin and the starting column
Parameters:
integer |
$align: |
text alignment |
integer |
$textWidth: |
text width |
integer |
$col: |
Orizontal position where start to print the text. This value will be added to the left margin. |
API Tags:
boolean _CalculatePos(
integer
$nUnit, string
$unit
)
|
|
Internal function used to calculate the movement.
Parameters:
integer |
$nUnit: |
Numebr of 'unit' may be less or greater then zero |
string |
$unit: |
measurement used to set the movement |
API Tags:
void _CheckMarginValue(
)
|
|
Check the value for the margin. They should be >0 and less then the page size
API Tags:
Redefined in descendants as:
-
PSPrint::_CheckMarginValue()
: Check the value for the margin. They should be >0 and less then the page size. The PSPrint version, before to call the APrint method check whether the page size is set.
Define some dafault font
API Tags:
Redefined in descendants as:
inizialize all parameter about the page size Require a printer handler.
Unit used: twip,
- inch = 1440 twip
- mm = 56.7 twip
API Tags:
Redefined in descendants as:
Printout page number and script name as footer
API Tags:
Redefined in descendants as:
Establish the connection to the printer
API Tags:
Redefined in descendants as:
void _SetFont(
[int
$fnt = -1]
)
|
|
Activate the specified font
Parameters:
int |
$fnt: |
font handle returned by CreateFont |
API Tags:
Redefined in descendants as: