XOOPS  2.6.0
HtmlToPdfProvider Class Reference
Inheritance diagram for HtmlToPdfProvider:
Inheritance graph

Public Member Functions

 __construct ()
 
 addHtml ($response, $html)
 
 fetchPdf ($response)
 
 getDescription ()
 
 getName ()
 
 outputPdfDownload ($response, $name)
 
 outputPdfInline ($response, $name)
 
 setAuthor ($response, $pdfAuthor)
 
 setBaseFont ($response, $fontFamily, $fontStyle= '', $fontSize=null)
 
 setBaseUnit ($response, $unit)
 
 setDefaultMonospacedFont ($response, $monoFontFamily)
 
 setKeywords ($response, $pdfKeywords)
 
 setMargins ($response, $leftMargin, $topMargin, $rightMargin, $bottomMargin)
 
 setPageOrientation ($response, $pageOrientation)
 
 setPageSize ($response, $pageSize)
 
 setSubject ($response, $pdfSubject)
 
 setTitle ($response, $pdfTitle)
 
 startPdf ($response)
 
- Public Member Functions inherited from Xoops\Core\Service\AbstractContract
 getDescription ()
 
 getMode ()
 
 getName ()
 
 getPriority ()
 
 setPriority ($priority)
 

Protected Member Functions

 resetPdf ()
 

Protected Attributes

 $bottomMargin
 
 $fontFamily
 
 $fontSize
 
 $fontStyle
 
 $leftMargin
 
 $moduleConfigs
 
 $monoFontFamily
 
 $pageOrientation = 'P'
 
 $pageSize = 'A4'
 
 $pdfAuthor
 
 $pdfCreator
 
 $pdfEngine
 
 $pdfKeywords
 
 $pdfSubject
 
 $pdfTitle
 
 $rightMargin
 
 $topMargin
 
 $unit = 'mm'
 
- Protected Attributes inherited from Xoops\Core\Service\AbstractContract
 $priority = Manager::PRIORITY_MEDIUM
 

Private Member Functions

 decodeEntities ($text)
 
 initPdf ()
 
 setFromConfigs ($name, $property, $default)
 

Private Attributes

 $moddir = 'pdf'
 

Additional Inherited Members

- Public Attributes inherited from Xoops\Core\Service\Contract\HtmlToPdfInterface
const MODE = \Xoops\Core\Service\Manager::MODE_EXCLUSIVE
 

Detailed Description

Definition at line 26 of file HtmlToPdfProvider.php.

Constructor & Destructor Documentation

HtmlToPdfProvider::__construct ( )

__construct

Definition at line 88 of file HtmlToPdfProvider.php.

References resetPdf().

Here is the call graph for this function:

Member Function Documentation

HtmlToPdfProvider::addHtml (   $response,
  $html 
)

addHtml - add HTML formatted text to document. This may be called multiple times

Parameters
Response$responseobject
string$htmlHTML formated text to include in document array user info, 'uid', 'uname' and 'email' required
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 361 of file HtmlToPdfProvider.php.

References $html, and initPdf().

Here is the call graph for this function:

HtmlToPdfProvider::decodeEntities (   $text)
private

decodeEntities - handles numeric entities

Parameters
string$texttext to decode
Returns
string decoded string

Definition at line 467 of file HtmlToPdfProvider.php.

References $text.

Referenced by setAuthor(), setSubject(), and setTitle().

Here is the caller graph for this function:

HtmlToPdfProvider::fetchPdf (   $response)

fetchPdf - fetch rendered document as a string

Parameters
Response$responseobject
Returns
void - response->value set to string containing document

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 411 of file HtmlToPdfProvider.php.

References $response, and initPdf().

Here is the call graph for this function:

HtmlToPdfProvider::getDescription ( )

getDescription - get human readable description of the service provider

Returns
string

Definition at line 170 of file HtmlToPdfProvider.php.

HtmlToPdfProvider::getName ( )

getName - get a short name for this service provider. This should be unique within the scope of the named service, so using module dirname is suggested.

Returns
string - a unique name for the service provider

Definition at line 160 of file HtmlToPdfProvider.php.

HtmlToPdfProvider::initPdf ( )
private

initPdf - initialize TCPDF with current setting

Returns
void

Definition at line 423 of file HtmlToPdfProvider.php.

Referenced by addHtml(), fetchPdf(), outputPdfDownload(), and outputPdfInline().

Here is the caller graph for this function:

HtmlToPdfProvider::outputPdfDownload (   $response,
  $name 
)

outputPdfDownload - output a named pdf document file for download

Parameters
Response$responseobject
string$namefilename for file
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 394 of file HtmlToPdfProvider.php.

References $name, and initPdf().

Here is the call graph for this function:

HtmlToPdfProvider::outputPdfInline (   $response,
  $name 
)

outputPdfInline - output a named pdf document file inline

Parameters
Response$responseobject
string$namefilename for file
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 376 of file HtmlToPdfProvider.php.

References $name, and initPdf().

Here is the call graph for this function:

HtmlToPdfProvider::resetPdf ( )
protected

resetPdf - resets to default state

Returns
void

Definition at line 115 of file HtmlToPdfProvider.php.

References Xoops\getInstance(), and setFromConfigs().

Referenced by __construct(), and startPdf().

Here is the call graph for this function:

Here is the caller graph for this function:

HtmlToPdfProvider::setAuthor (   $response,
  $pdfAuthor 
)

setAuthor - set author in pdf meta data

Parameters
Response$responseobject
string$pdfAuthorauthor name
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 294 of file HtmlToPdfProvider.php.

References $pdfAuthor, and decodeEntities().

Here is the call graph for this function:

HtmlToPdfProvider::setBaseFont (   $response,
  $fontFamily,
  $fontStyle = '',
  $fontSize = null 
)

setBaseFont - set the base font used in rendering

Parameters
Response$responseobject
string$fontFamilyfont family
string$fontStylefont style ('bold', 'italic', etc.)
float$fontSizefont size in points
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 260 of file HtmlToPdfProvider.php.

References $fontFamily, $fontSize, and $fontStyle.

HtmlToPdfProvider::setBaseUnit (   $response,
  $unit 
)

setBaseUnit - set unit of measure for page size, margins, etc.

Parameters
Response$responseobject
string$unitunit used in page size, margins. Possible values include 'mm' = millimeter, "in" = inches, 'pt' = typographic points
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 216 of file HtmlToPdfProvider.php.

References $unit.

HtmlToPdfProvider::setDefaultMonospacedFont (   $response,
  $monoFontFamily 
)

setDefaultMonospacedFont - default monotype font used in rendering

Parameters
Response$responseobject
string$monoFontFamilyfont family
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 278 of file HtmlToPdfProvider.php.

References $monoFontFamily.

HtmlToPdfProvider::setFromConfigs (   $name,
  $property,
  $default 
)
private

setFromConfigs - set property from config value or default

Parameters
string$nameconfig name
string$propertyproperty name
mixed$defaultdefault value
Returns
void

Definition at line 102 of file HtmlToPdfProvider.php.

References $name.

Referenced by resetPdf().

Here is the caller graph for this function:

HtmlToPdfProvider::setKeywords (   $response,
  $pdfKeywords 
)

setKeywords - set keywords in pdf meta data

Parameters
Response$responseobject
string[]$pdfKeywords array of keywords pertaining to document
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 342 of file HtmlToPdfProvider.php.

References $pdfKeywords.

HtmlToPdfProvider::setMargins (   $response,
  $leftMargin,
  $topMargin,
  $rightMargin,
  $bottomMargin 
)

setMargins - set margin sizes

Parameters
Response$responseobject
float$leftMarginleft margin in base units,
See also
setBaseUnits()
Parameters
float$topMargintop margin in base units
float$rightMarginright margin in base units
float$bottomMarginbottom margin in base units
Returns
void - response->value set to absolute URL to avatar image

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 235 of file HtmlToPdfProvider.php.

References $bottomMargin, $leftMargin, $rightMargin, and $topMargin.

HtmlToPdfProvider::setPageOrientation (   $response,
  $pageOrientation 
)

setPageOrientation - set page orientation

Parameters
Response$responseobject
string$pageOrientationpage orientation, 'P' for portrait, 'L' for landscape
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 183 of file HtmlToPdfProvider.php.

References $pageOrientation.

HtmlToPdfProvider::setPageSize (   $response,
  $pageSize 
)

setPageSize - set standard page size

Parameters
Response$responseobject
string$pageSizestandard named page size, i.e. 'LETTER', 'A4', etc.
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 199 of file HtmlToPdfProvider.php.

References $pageSize.

HtmlToPdfProvider::setSubject (   $response,
  $pdfSubject 
)

setSubject - set subject in pdf meta data

Parameters
Response$responseobject
string$pdfSubjectdocument subject
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 326 of file HtmlToPdfProvider.php.

References $pdfSubject, and decodeEntities().

Here is the call graph for this function:

HtmlToPdfProvider::setTitle (   $response,
  $pdfTitle 
)

setTitle - set title in pdf meta data

Parameters
Response$responseobject
string$pdfTitledocument title
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 310 of file HtmlToPdfProvider.php.

References $pdfTitle, and decodeEntities().

Here is the call graph for this function:

HtmlToPdfProvider::startPdf (   $response)

startPdf - start a new pdf

Parameters
Response$responseobject
Returns
void

Implements Xoops\Core\Service\Contract\HtmlToPdfInterface.

Definition at line 149 of file HtmlToPdfProvider.php.

References resetPdf().

Here is the call graph for this function:

Member Data Documentation

HtmlToPdfProvider::$bottomMargin
protected

Definition at line 53 of file HtmlToPdfProvider.php.

Referenced by setMargins().

HtmlToPdfProvider::$fontFamily
protected

Definition at line 56 of file HtmlToPdfProvider.php.

Referenced by setBaseFont().

HtmlToPdfProvider::$fontSize
protected

Definition at line 62 of file HtmlToPdfProvider.php.

Referenced by setBaseFont().

HtmlToPdfProvider::$fontStyle
protected

Definition at line 59 of file HtmlToPdfProvider.php.

Referenced by setBaseFont().

HtmlToPdfProvider::$leftMargin
protected

Definition at line 44 of file HtmlToPdfProvider.php.

Referenced by setMargins().

HtmlToPdfProvider::$moddir = 'pdf'
private

Definition at line 29 of file HtmlToPdfProvider.php.

HtmlToPdfProvider::$moduleConfigs
protected

Definition at line 83 of file HtmlToPdfProvider.php.

HtmlToPdfProvider::$monoFontFamily
protected

Definition at line 65 of file HtmlToPdfProvider.php.

Referenced by setDefaultMonospacedFont().

HtmlToPdfProvider::$pageOrientation = 'P'
protected

Definition at line 35 of file HtmlToPdfProvider.php.

Referenced by setPageOrientation().

HtmlToPdfProvider::$pageSize = 'A4'
protected

Definition at line 38 of file HtmlToPdfProvider.php.

Referenced by setPageSize().

HtmlToPdfProvider::$pdfAuthor
protected

Definition at line 68 of file HtmlToPdfProvider.php.

Referenced by setAuthor().

HtmlToPdfProvider::$pdfCreator
protected

Definition at line 80 of file HtmlToPdfProvider.php.

HtmlToPdfProvider::$pdfEngine
protected

Definition at line 32 of file HtmlToPdfProvider.php.

HtmlToPdfProvider::$pdfKeywords
protected

Definition at line 77 of file HtmlToPdfProvider.php.

Referenced by setKeywords().

HtmlToPdfProvider::$pdfSubject
protected

Definition at line 74 of file HtmlToPdfProvider.php.

Referenced by setSubject().

HtmlToPdfProvider::$pdfTitle
protected

Definition at line 71 of file HtmlToPdfProvider.php.

Referenced by setTitle().

HtmlToPdfProvider::$rightMargin
protected

Definition at line 50 of file HtmlToPdfProvider.php.

Referenced by setMargins().

HtmlToPdfProvider::$topMargin
protected

Definition at line 47 of file HtmlToPdfProvider.php.

Referenced by setMargins().

HtmlToPdfProvider::$unit = 'mm'
protected

Definition at line 41 of file HtmlToPdfProvider.php.

Referenced by setBaseUnit().


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