phpDocumentor Aprint
[ Back ] [ class tree: Aprint ] [ index: Aprint ] [ all elements ]

Class: PSPrint

Source Location: /psprint.php

Class PSPrint

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From APrint

APrint::$AutoNewPage
APrint::$CallBacks
APrint::$CallBacksParm
APrint::$ConnectionOpened
APrint::$CurrentFont
APrint::$FontH
APrint::$FontTable
APrint::$FontW
APrint::$hPrinter
APrint::$JobTitle
APrint::$MarginBottom
APrint::$MarginLeft
APrint::$MarginRight
APrint::$MarginTop
APrint::$NewPageHeader
APrint::$NPag
APrint::$PaperDimX
APrint::$PaperDimY
APrint::$PrinterName
APrint::$PrintPageFooter
APrint::$Res_X
APrint::$Res_Y
APrint::$row
APrint::$ScriptId
APrint::$ValidCallbacks
APrint::$ValidMeasure

Inherited From APrint

APrint::APrint()
Initialize this class. It doesn not attempt to
APrint::BlankRow()
Skip a row, left a blank row.
APrint::Conv2Twip_x()
Convert the printer point size into internal point size according to its resolution
APrint::Conv2Twip_y()
APrint::CreateFont()
Create a new font
APrint::GetPageSize()
Retrieve the page size
APrint::HeaderText()
Write an header at the top of the first page.
APrint::Line()
Draw a dash line.
APrint::MvAbsolutePos()
Move the currentline to nRow. It return TRUE on success,
APrint::MvBottom()
Move to the last row before the bottom margin It return TRUE on success, FALSE otherwise.
APrint::MvRelativePos()
Move the currentline up or down of nRow rows. It return TRUE on success,
APrint::MvTop()
Move to the first row after the top margin It return TRUE on success,
APrint::NewPage()
Close the current page and start a new one.
APrint::OpenPrinter()
Start the connection to the printer. This is the public interface to _OpenPrinter.
APrint::PrintPageHeader()
Print the page header
APrint::ResConv_x()
Convert the internal point size to the printer point size according to its resolution
APrint::ResConv_y()
APrint::run()
Close the output to the printer and start to print
APrint::SetAutoNewPage()
Set the AutoNewPage flag. If set to true, the module call the functionNewPage
APrint::SetBottomMargin()
Set the size for the bottom margin
APrint::SetCallBack()
Set the callback function
APrint::SetLeftMargin()
Set the size for the left margin
APrint::SetMargin()
Useful function to setup all margins with one function use -1 to skip the parameter
APrint::SetPageHeader()
Setup the text to print on each page.
APrint::SetPrinter()
Specifiy which printer I'll use. If you don't give any printer, the default printer will be used.
APrint::SetPrintFooter()
Set if the module should print its own footer or not.
APrint::SetRightMargin()
Set the size for the right margin
APrint::SetTopMargin()
Set the size for the top margin
APrint::Text()
printout the text
APrint::TextFooter()
Print the given text as page footer
APrint::TextXY()
printout the text at the exact position requested
APrint::_BeginCol()
This function compute the starting position given the
APrint::_CalculatePos()
Internal function used to calculate the movement.
APrint::_CheckMarginValue()
Check the value for the margin. They should be >0 and less then the page size
APrint::_DefaultFont()
Define some dafault font
APrint::_DefinePageSize()
inizialize all parameter about the page size Require a printer handler.
APrint::_FooterNote()
Printout page number and script name as footer
APrint::_OpenPrinter()
Establish the connection to the printer
APrint::_SetFont()
Activate the specified font

[ Top ]
Property Summary
string   $FileName   File Postscript to write
array   $FontPath   Path to fonts file
resource   $hDoc   Document handler
integer   $Interlinea   Space between two rows
boolean   $IsSizeSet   Is the page size set?
integer   $Orientation   Paper orientation, supported only by ps module

[ Top ]
Method Summary
PSPrint   PSPrint()   Initialize this class. It does not attempt to
void   CreateFont()   Create new font
void   NewPage()   Close the current page and start the new one.
void   OpenFileName()   Start the connection to the printer. This is the public interface to _OpenPrinter.
void   PrintPageHeader()   Print the page header
void   run()   Close the output.
void   SetCustomPageSize()   Set custom page size. The dimension must be points.
void   SetFileName()   Set the name of the file to write
void   SetFontPath()   Set the path where the font file .afm are located. The Postscript module require Notice: if the ps module is not created, the class store the information until it will be created and then set the given path.
void   SetMargin()   Useful function to setup all margins with one function use -1 to skip the parameter
void   SetPageSize()   The page size. This function accept the well known page forms
void   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   SetTopMargin()   Set the size for the top margin
void   Text()   printout the text
void   TextFooter()   Print the given text as page footer
void   TextXY()   printout the text at the exact position requested
void   _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.
void   _DefaultFont()   Define some dafault font
void   _DefinePageSize()   The Aprint module take the page size from the printer. Here the user must provide the
void   _FooterNote()   Printout page number and script name as footer
void   _OpenPrinter()   Open the output printer (APrint) or the output file (PSPrint)
void   _SetFont()   Activate the specified font
integer   _VPoint()   The ps module set the point zero to the bottom edge of the page, the module has its point zero on the top edge, the function converts the vertical value from both systems.

[ Top ]
Properties
string   $FileName [line 54]

File Postscript to write


[ Top ]
array   $FontPath [line 80]

Path to fonts file


[ Top ]
resource   $hDoc [line 60]

Document handler


[ Top ]
integer   $Interlinea [line 75]

Space between two rows


[ Top ]
boolean   $IsSizeSet [line 70]

Is the page size set?


[ Top ]
integer   $Orientation [line 65]

Paper orientation, supported only by ps module


[ Top ]
Methods
Constructor PSPrint  [line 89]

  PSPrint PSPrint( [string $TitleText = ""], [string $ScriptId = ""]  )

Initialize this class. It does not attempt to

open the output file 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:
Access:  public


[ Top ]
CreateFont  [line 480]

  void CreateFont( [string $fName = "Courier"], [integer $fHeight = 240], [integer $fWidth = 120], [integer $fWeight = 400], [boolean $fItalic = false], [boolean $fUnderline = false], [boolean $fStrikeout = false], [mixed $fOrientaton = 0], integer $fOrientation  )

Create new font

Parameters:
string   $fName:  Font Name. Set the path to the font file. The ps extension should take the path from the function set_pathname, but on my system it doesn't work (ps 1.3.0 + pslib 0.2.5). So I must provide here the full pathname (absolute or relative) to the font file
integer   $fHeight:  Font height, default: 336
integer   $fWidth:  Font width, default: 168 (PsPrint unused)
integer   $fWeight:  Font weight, default: 400. 0 -> thin, 800 -> bold (PsPrint unused)
boolean   $fItalic:  Italic script? True/False (PsPrint unused)
boolean   $fUnderline:  Text with underline? True/False
boolean   $fStrikeout:  True/False (PsPrint unused)
integer   $fOrientation:  Should be always 3 digits, i.e 020. See printer_create_font in the note to the manual (PsPrint unused)

API Tags:
Access:  public
See:  PSPrint::SetFontPath()
See:  PSPrint::Text()
See:  PSPrint::_SetFont()


Redefinition of:
APrint::CreateFont()
Create a new font

[ Top ]
NewPage  [line 414]

  void NewPage( )

Close the current page and start the new one.


API Tags:
Access:  public


Redefinition of:
APrint::NewPage()
Close the current page and start a new one.

[ Top ]
OpenFileName  [line 539]

  void OpenFileName( [string $FileName = ""]  )

Start the connection to the printer. This is the public interface to _OpenPrinter.

Parameters:
string   $FileName:  Name of the printer to use. If not set use the system default

API Tags:
See:  PSPrint::_OpenPrinter()
Access:  public


[ Top ]
PrintPageHeader  [line 331]

  void PrintPageHeader( )

Print the page header


API Tags:
See:  PSPrint::Text()
Access:  public


Redefinition of:
APrint::PrintPageHeader()
Print the page header

[ Top ]
run  [line 401]

  void run( )

Close the output.


API Tags:
Access:  public


Redefinition of:
APrint::run()
Close the output to the printer and start to print

[ Top ]
SetCustomPageSize  [line 179]

  void SetCustomPageSize( integer $DimX, integer $DimY, integer $Orientation  )

Set custom page size. The dimension must be points.

  1. inch = 1440 points
  1. mm = 56.7 twip

Parameters:
integer   $DimX: 
integer   $DimY: 
integer   $Orientation: 

API Tags:
Access:  public
See:  AP_LANDSCAPE
See:  AP_PORTRAIT


[ Top ]
SetFileName  [line 249]

  void SetFileName( string $Name  )

Set the name of the file to write

Parameters:
string   $Name: 

API Tags:
Access:  public


[ Top ]
SetFontPath  [line 579]

  void SetFontPath( string $Path  )

Set the path where the font file .afm are located. The Postscript module require Notice: if the ps module is not created, the class store the information until it will be created and then set the given path.

The ps extension should take the path from the function set_pathname, but on my system it doesn't work (ps 1.3.0 + pslib 0.2.5). So I must provide here the full pathname (absolute or relative) to the font file as parameter to CreateFont()

Parameters:
string   $Path: 

API Tags:
See:  PSPrint::CreateFont()
Access:  public


[ Top ]
SetMargin  [line 199]

  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:
Access:  public


Redefinition of:
APrint::SetMargin()
Useful function to setup all margins with one function use -1 to skip the parameter

[ Top ]
SetPageSize  [line 126]

  void SetPageSize( [string $PageType = 'A4'], mixed $orientation  )

The page size. This function accept the well known page forms

LEGAL,LETTER, A3,A4,A5, B4, B5

Parameters:
string   $PageType: 

API Tags:
See:  PSPrint::SetCustomPageSize()
Access:  public


[ Top ]
SetPrinter  [line 237]

  void SetPrinter( string $Name  )

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.

Parameters:
string   $Name:  printer name as defined in Window

API Tags:
See:  PSPrint::SetFileName()


Redefinition of:
APrint::SetPrinter()
Specifiy which printer I'll use. If you don't give any printer, the default printer will be used.

[ Top ]
SetTopMargin  [line 210]

  void SetTopMargin( integer $value  )

Set the size for the top margin

Parameters:
integer   $value: 

API Tags:
Access:  public


Redefinition of:
APrint::SetTopMargin()
Set the size for the top margin

[ Top ]
Text  [line 267]

  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. If set to -1 or not provided, it use the last used font.
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:
See:  PSPrint::TextFooter()
See:  PSPrint::CreateFont()
Access:  public


Redefinition of:
APrint::Text()
printout the text

[ Top ]
TextFooter  [line 373]

  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:
See:  PSPrint::Text()
See:  PSPrint::CreateFont()
Access:  public


Redefinition of:
APrint::TextFooter()
Print the given text as page footer

[ Top ]
TextXY  [line 302]

  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:
See:  PSPrint::Text()
See:  PSPrint::CreateFont()
Access:  public


Redefinition of:
APrint::TextXY()
printout the text at the exact position requested

[ Top ]
_CheckMarginValue  [line 222]

  void _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.


API Tags:
Access:  private


Redefinition of:
APrint::_CheckMarginValue()
Check the value for the margin. They should be >0 and less then the page size

[ Top ]
_DefaultFont  [line 590]

  void _DefaultFont( )

Define some dafault font


API Tags:
Access:  private


Redefinition of:
APrint::_DefaultFont()
Define some dafault font

[ Top ]
_DefinePageSize  [line 115]

  void _DefinePageSize( )

The Aprint module take the page size from the printer. Here the user must provide the

page size Unit used: twip,

  1. inch = 1440 twip
  1. mm = 56.7 twip


API Tags:
See:  PSPrint::SetCustomPageSize()
See:  PSPrint::SetPageSize()
Access:  private


Redefinition of:
APrint::_DefinePageSize()
inizialize all parameter about the page size Require a printer handler.

[ Top ]
_FooterNote  [line 443]

  void _FooterNote( )

Printout page number and script name as footer


API Tags:
Access:  private


Redefinition of:
APrint::_FooterNote()
Printout page number and script name as footer

[ Top ]
_OpenPrinter  [line 505]

  void _OpenPrinter( )

Open the output printer (APrint) or the output file (PSPrint)


API Tags:
See:  PSPrint::OpenFileName()
Access:  private


Redefinition of:
APrint::_OpenPrinter()
Establish the connection to the printer

[ Top ]
_SetFont  [line 552]

  void _SetFont( [int $fnt = -1]  )

Activate the specified font

Parameters:
int   $fnt:  font handle returned by CreateFont

API Tags:
See:  PSPrint::CreateFont()
Access:  private


Redefinition of:
APrint::_SetFont()
Activate the specified font

[ Top ]
_VPoint  [line 606]

  integer _VPoint( integer $PosY  )

The ps module set the point zero to the bottom edge of the page, the module has its point zero on the top edge, the function converts the vertical value from both systems.

Parameters:
integer   $PosY:  Vertical position (Aprint system)

API Tags:
Return:  Vertical position (Ps system)
Access:  private


[ Top ]

Documentation generated on Sun, 13 Feb 2005 22:02:55 +0100 by phpDocumentor 1.3.0RC3