Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\IO\Pdf Class Reference
Inheritance diagram for Galette\IO\Pdf:
Collaboration diagram for Galette\IO\Pdf:

Public Member Functions

 __construct (Preferences $prefs, ?PdfModel $model=null)
 
 init ()
 
 showPagination ()
 
 __destruct ()
 
 Error (mixed $msg)
 
 colorHex2Dec (string $hex6)
 
 Header ()
 
 Footer (TCPDF $pdf=null)
 
 PageHeader (string $title=null)
 
 PageBody ()
 
 getFilename ()
 
 download ()
 

Public Attributes

const FONT = 'DejaVuSans'
 
const FONT_SIZE = 10
 

Protected Member Functions

 setNoHeader ()
 
 setNoFooter ()
 
 modelPageHeader (string $title=null)
 
 standardPageHeader (string $title=null)
 
 fixSize (string $text, int $maxsize, int $fontsize, string $fontstyle='', string $fontname=null)
 
 cut (string $str, int $length)
 
 stretchHead (string $str, int $length)
 

Protected Attributes

Preferences $preferences
 
I18n $i18n
 
string $filename
 
float $footer_height
 

Detailed Description

PDF class for galette

Author
John Perr johnp.nosp@m.err@.nosp@m.abul..nosp@m.org
Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be

Constructor & Destructor Documentation

◆ __construct()

Galette\IO\Pdf::__construct ( Preferences  $prefs,
?PdfModel  $model = null 
)

Main constructor, set creator and author

Parameters
Preferences$prefsPreferences
?PdfModel$model Related model

◆ __destruct()

Galette\IO\Pdf::__destruct ( )

Destructor

Member Function Documentation

◆ colorHex2Dec()

Galette\IO\Pdf::colorHex2Dec ( string  $hex6)

Converts color from HTML format #RRVVBB to RGB 3 colors array.

Parameters
string$hex67 chars string #RRVVBB
Returns
array<string,float|int>

◆ cut()

Galette\IO\Pdf::cut ( string  $str,
int  $length 
)
protected

Cut a string

Parameters
string$strOriginal string
integer$lengthMax length
Returns
string

◆ download()

Galette\IO\Pdf::download ( )

Download PDF from browser

Returns
string

Reimplemented in Galette\IO\PdfContribution.

◆ Error()

Galette\IO\Pdf::Error ( mixed  $msg)

This method is automatically called in case of fatal error; it simply outputs the message and halts the execution. An inherited class may override it to customize the error handling but should always halt the script, or the resulting document would probably be invalid. 2004-06-11 :: Nicola Asuni : changed bold tag with strong 2007-07-21 :: John Perr : changed function to return error to session 2017-02-14 :: Johan Cwiklinski : use slim's flash message; do not rely on session for redirect

Parameters
string$msgThe error message
Returns
void @access public
Since
1.0

◆ fixSize()

Galette\IO\Pdf::fixSize ( string  $text,
int  $maxsize,
int  $fontsize,
string  $fontstyle = '',
string  $fontname = null 
)
protected

Fix text size

Parameters
string$textText content
integer$maxsizeMaximal size
integer$fontsizeFont size
string$fontstyleFont style (defaults to '')
?string$fontname Font name (defaults to static::FONT)
Returns
void

◆ Footer()

Galette\IO\Pdf::Footer ( TCPDF  $pdf = null)

Draws PDF page footer

Parameters
?TCPDF$pdf PDF instance
Returns
void

◆ getFilename()

Galette\IO\Pdf::getFilename ( )

Get filename

Returns
string

Reimplemented in Galette\IO\PdfContribution.

◆ Header()

Galette\IO\Pdf::Header ( )

Draws PDF page Header

Returns
void

Reimplemented in Galette\IO\PdfGroups, and Galette\IO\PdfAttendanceSheet.

◆ init()

Galette\IO\Pdf::init ( )

◆ modelPageHeader()

Galette\IO\Pdf::modelPageHeader ( string  $title = null)
protected

Draws models PDF page header

Parameters
?string$title Additional title to display just after logo
Returns
void

◆ PageBody()

Galette\IO\Pdf::PageBody ( )

Draws body from model

Returns
void

◆ PageHeader()

Galette\IO\Pdf::PageHeader ( string  $title = null)

Draws PDF page header

Parameters
?string$title Additional title to display just after logo
Returns
void

◆ setNoFooter()

Galette\IO\Pdf::setNoFooter ( )
protected

No footer

Returns
void

◆ setNoHeader()

Galette\IO\Pdf::setNoHeader ( )
protected

No header

Returns
void

◆ showPagination()

Galette\IO\Pdf::showPagination ( )

Set show pagination

Returns
void

◆ standardPageHeader()

Galette\IO\Pdf::standardPageHeader ( string  $title = null)
protected

Draws standard PDF page header

Parameters
?string$title Additional title to display just after logo
Returns
void

◆ stretchHead()

Galette\IO\Pdf::stretchHead ( string  $str,
int  $length 
)
protected

Stretch a header string

Parameters
string$strOriginal string
integer$lengthMax length
Returns
string

The documentation for this class was generated from the following file: