pdf

Extends \TCPDF

package

Default

Methods

Initialize and configure TCPDF with the settings in our config file

__construct() 

Add answer to PDF

addAnswer( $sQuestion,  $sResponse,  $bReplaceExpressions = true,  $bAllowBreakPage = false) : void

Arguments

$sQuestion

  • Question field text array

$sResponse

  • Answer field text array

$bReplaceExpressions

  • Try to replace LimeSurvey Expressions. This is false when exporting answers PDF from admin GUI because we can not interpret expressions so just purify. TODO: Find a universal valid method to interpret expressions

$bAllowBreakPage

  • Allow break cell in two pages

Add GID text to PDF

addGidAnswer( $sGroupName, string $sGroupDescription,  $bAllowBreakPage = false) : void

Arguments

$sGroupName

  • Group name

$sGroupDescription

string

  • Group description

$bAllowBreakPage

  • Allow break cell in two pages

Add header to pdf

addHeader( $aPdfLanguageSettings,  $sSiteName,  $sDefaultHeaderString) : void

Arguments

$aPdfLanguageSettings

  • Pdf language settings

$sSiteName

  • LimeSurvey site name (header and metadata)

$sDefaultHeaderString

  • TCPDF header string

Add title to pdf

addTitle( $sTitle,  $sSubtitle = "") : void

Arguments

$sTitle

  • Title

$sSubtitle

  • Subtitle

delete_html

delete_html( $text) 

Arguments

$text

Creates a Table with equal cell width.

equalTable( $array,  $modulo = 1) : void

Arguments

$array

  • table array( 0=> array("td", "td", "td"), 1=> array("td", "td", "td"))

$modulo

  • fills each second row with a light-grey for better visibility. Default is on turn off with 0

gets the width for each column in tables, based on pagewidth and count of columns.

getEqualWidth( $array) : \unknown_type

Good for static tables with equal value String-length

Arguments

$array

Response

\unknown_type

Gets the width for columns in a table based on their Stringlength and the width of the page.

getFullWidth( $array) : array

..

Arguments

$array

Response

array

with column width

getmaxwidth

getmaxwidth( $array) 

Arguments

$array

getminwidth

getminwidth( $array) 

Arguments

$array

creates a table with a bold head using the full width of page

headTable( $head,  $table,  $modulo = 1) : void

Arguments

$head

  • head array( 0=> array("th", "th", "th"))

$table

  • table array( 0=> array("td", "td", "td"), 1=> array("td", "td", "td"))

$modulo

  • fills each second row with a light-grey for better visibility. Default is on, turn off with 0

Create Answer PDF document, set metadata and set title

initAnswerPDF( $aSurveyInfo,  $aPdfLanguageSettings,  $sSiteName,  $sSurveyName,  $sDefaultHeaderString = '') : void

Arguments

$aSurveyInfo

  • Survey Information (preventing from passing to methods every time)

$aPdfLanguageSettings

  • Pdf language settings

$sSiteName

  • LimeSurvey site name (header and metadata)

$sSurveyName

  • Survey name (header, metadata and title),

$sDefaultHeaderString

  • TCPDF header string

intopdf

intopdf(string $text,  $format = '') : void
deprecated

Arguments

$text

string

$format

Set _config for pdf

setConfig(mixed $tcpdf) : 
access

public

Arguments

$tcpdf

mixed

Response

Creates a Table with equal cell width and Bold text. Used as Head for equalTable()

tablehead( $array) : void

Arguments

$array

Creates a table using the full width of page

tableintopdf( $array,  $modulo = 1) : void

Arguments

$array

Table array( 0=> array("td", "td", "td"), 1=> array("td", "td", "td"))

$modulo

Fills each second row with a light-grey for better visibility. Default is off, turn on with 1

Writes a big title in the page + description

titleintopdf( $title,  $description = '') : void

Arguments

$title

$description

write_out

write_out( $name) 

Arguments

$name

Properties

TCPDF system constants that map to settings in our config file

cfg_constant_map : array
var
access

private

Type(s)

array

Settings from our APPPATH/config/tcpdf.php file

_config : array
var
access

private

Type(s)

array

Base font size for answer PDF export

_ibaseAnswerFontSize : integer
var
access

private

Type(s)

integer

Cell height for answer PDF export

_iCellHeight : integer
var
access

private

Type(s)

integer

Survey Information (preventing from passing to methods every time)

_aSurveyInfo : array
var
access

private

Type(s)

array