Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /var/www/html/php_jh_pdf-1.1.0/class.jh_pdf_text-1.1.0.inc.php
php_jh_pdf -

jh_pdf_text

jh_pdf_base
   |
  +-- jh_pdf_text

Class for text output on PDF documents

 

public class jh_pdf_text extends jh_pdf_base

Class for text output on PDF documents
Collects text into a buffer and then puts it onto a PDF documentwith automatic line wrapping. This wrapping can be word orcharacter based.

 
Direct known subclasses: jh_pdf_flowingtext, jh_pdf_text_jhpci

Methods inherited from jh_pdf_base

setcolor

Public Method Summary

void

jh_pdf_text( &$pdf)

Constructor
void

setwidth(float $width)

Set the text block width
void

setfontface(string $fontface)

Set the font face
void

setfontsize(float $fontsize)

Set the font size
void

setfontcolor(mixed $fontcolor)

Set the font color
void

setfontparset(array $parameters)

Set the font parameters
void

setwrapmethod(string $method)

Set the method for line wrapping
void

addtext(string $text, boolean $sep)

Append a string to the text buffer
void

getrequiredlinenum()

Returns the number of required output lines
void

getrequiredheight(float $leading)

Returns the required output height
void

puttext(float $xpos, float $ypos, string $alignment, float $leading)

Output the the via the integrated layout engine
void

puttext2(float $xpos, float $ypos, string $alignment, float $leading)

Outputs the the via PDF_show_boxed()

Private Field Summary

unknown

$pdf

unknown

$width

unknown

$currentline

unknown

$lines

unknown

$linewidths

unknown

$newparagraph

unknown

$fontface

unknown

$fontsize

unknown

$fontcolor

unknown

$fontparset

unknown

$wrapmethod

unknown

$buffer

unknown

$layoutvalid

Public Method Details

jh_pdf_text

public void jh_pdf_text( &$pdf )

  Constructor

Parameter
&$pdf
Warning: documentation is missing.
Returns void


setwidth

public void setwidth( float $width )

  Set the text block width
Sets the text block width meassured in PDF pixels.

Parameter
float $width
The width meassured in PDF pixels
Returns void


setfontface

public void setfontface( string $fontface )

  Set the font face
Sets the font face which will be used for the text block.

Parameter
string $fontface
The font face (e.g. "Helvetica",
"Times Roman")
Returns void


setfontsize

public void setfontsize( float $fontsize )

  Set the font size
Sets the font size which will be used for the text block.

Parameter
float $fontsize
The font size
Returns void


setfontcolor

public void setfontcolor( mixed $fontcolor )

  Set the font color
Sets the font color which will be used for the text block.

Parameter
mixed $fontcolor
The font color
Returns void


setfontparset

public void setfontparset( array $parameters )

  Set the font parameters
Set the fonts parameters which will be used for the text block.

Parameter
array $parameters
The font parameters which will be set
("underline", "overline", "strikeout",
see PDFlib-manual).
Returns void


setwrapmethod

public void setwrapmethod( string $method )

  Set the method for line wrapping
Sets the method for line wrapping which will be used for thetext block.

Parameter
string $method
One out of "char", "word" and
"wordstrict".
"char" means to wrap the line before the
first character not fitting into the line.
"word" means to wrap the line before the
first word not completely fittig into the
line. If even one single word does not fit
into a line, it is wrapped like in "char"
mode.
"wordstrict" behaves like "word" except in
the case where even one single word does
not fit into a line. In this case the word
will remain unwrapped, thus reaching beyond
the specified rectangle.
Returns void


addtext

public void addtext( string $text, boolean $sep )

  Append a string to the text buffer
Appends a string to the current text buffer which will laterbe output via puttext().

Parameter
string $text
The string to be added
boolean $sep
Assures that the text will be seperated from
the current text by a space character
Returns void


getrequiredlinenum

public void getrequiredlinenum( )

  Returns the number of required output lines
Returns the number of lines which are required when the textis output with the current parameters (font face, font size andwrap method). Note that there will be no performance penaltywhen calling this method before puttext() as the resultsare cached in class variables. In fact, this method willbe called by puttext() anyway as this is the actual layoutengine!

Returns void


getrequiredheight

public void getrequiredheight( float $leading )

  Returns the required output height
Returns the number of pixels which are required when the textis output with the current parameters and the specified leading.

Parameter
float $leading
Text leading for which the required
height should be calculated.
Returns void


puttext

public void puttext( float $xpos, float $ypos, string $alignment, float $leading )

  Output the the via the integrated layout engine
Outputs the text via the integrated layout engine at thespecified coordinates, alignment and leading.

Parameter
float $xpos
The left starting position
float $ypos
The top starting position
string $alignment
"left"/"right"/"center"
float $leading
The text leading
Returns void


puttext2

public void puttext2( float $xpos, float $ypos, string $alignment, float $leading )

  Outputs the the via PDF_show_boxed()
Outputs the text via PDF_show_boxed() at thespecified coordinates, alignment and leading.

Parameter
float $xpos
The left starting position
float $ypos
The top starting position
string $alignment
"left"/"right"/"center"
float $leading
The text leading
Returns void


Private Field Details

$pdf

private unknown $pdf

>><<



$width

private unknown $width

>><<



$currentline

private unknown $currentline

>><<



$lines

private unknown $lines

>><<



$linewidths

private unknown $linewidths

>><<



$newparagraph

private unknown $newparagraph

>><<



$fontface

private unknown $fontface

>><<



$fontsize

private unknown $fontsize

>><<



$fontcolor

private unknown $fontcolor

>><<



$fontparset

private unknown $fontparset

>><<



$wrapmethod

private unknown $wrapmethod

>><<



$buffer

private unknown $buffer

>><<



$layoutvalid

private unknown $layoutvalid

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta