pdf

Extends\TCPDF

package

Default

Methods

Initialize and configure TCPDF with the settings in our config file

__construct()

Add answer to PDF

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

Arguments

$sQuestion

string

  • Question field text array

$sResponse

string

  • Answer field text array

$bReplaceExpressions

boolean

  • 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

boolean

  • 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(array $aPdfLanguageSettings,string $sSiteName,string $sDefaultHeaderString): void

Arguments

$aPdfLanguageSettings

array

  • Pdf language settings

$sSiteName

string

  • LimeSurvey site name (header and metadata)

$sDefaultHeaderString

string

  • TCPDF header string

Add title to pdf

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

Arguments

$sTitle

string

  • Title

$sSubtitle

string

  • Subtitle

delete_html

delete_html( $text)

Arguments

$text

Creates a Table with equal cell width.

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

Arguments

$array

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

$modulo

integer

  • 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): mixed

Good for static tables with equal value String-length

Arguments

$array

Response

mixed

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

Header

Header()

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(array $aSurveyInfo,array $aPdfLanguageSettings,string $sSiteName,string $sSurveyName,string $sDefaultHeaderString = ''): void

Arguments

$aSurveyInfo

array

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

$aPdfLanguageSettings

array

  • Pdf language settings

$sSiteName

string

  • LimeSurvey site name (header and metadata)

$sSurveyName

string

  • Survey name (header, metadata and title),

$sDefaultHeaderString

string

  • 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