quexmlpdf

Extends \pdf

A TCPDF based class to produce queXF compatible questionnaire PDF files and banding description XML from queXML

author

Adam Zammit adam.zammit@acspri.org.au

copyright

(c) 2010 Australian Consortium for Social and Political Research Incorporated (ACSPRI)

since 2010-09-02
link

http://www.acspri.org.au/software

link

http://quexml.sourceforge.net

link

http://quexf.sourceforge.net

Methods

setLanguage

setLanguage($language) 

Arguments

$language

Return the length of the longest word

wordLength(mixed $txt) : int
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-03-30

Arguments

$txt

mixed

Response

int

Length of longest word

Add a box group to the page layout system

addBoxGroup(int $type, string $varname, string $label = "", int $width = 1) 

VALUES(0, 'Temporary'); VALUES(1, 'Single choice'); VALUES(2, 'Multiple choice'); VALUES(3, 'Text'); VALUES(4, 'Number'); VALUES(5, 'Barcode'); VALUES(6, 'Long text');

author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-02

Arguments

$type

int

The type of box group for verification purposes

$varname

string

The variable name

$label

string

The label for the box group Optional, defaults to "".

$width

int

The width of this group Optional, defaults to 1.

Add a new box group which is a copy of the previous one (if exists)

addBoxGroupCopyPrevious() 
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-03-26

Add a box to the page layout system

addBox(int $tlx, int $tly, int $brx, int $bry, string $value = "", string $label = "") 

Arguments

$tlx

int

Top left X

$tly

int

Top left Y

$brx

int

Bottom right X

$bry

int

Bottom right Y

$value

string

Optional, defaults to "".

$label

string

Optional, defaults to "".

Set margin before questionnare info

setQuestionnaireInfoMargin(int $margin) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$margin

int

between 0 and 100mm

Get the margin before questionnaire info

getQuestionnaireInfoMargin() : int
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

int

Height in mm between 0 and 100

Set the height of responses items in a sub question matrix

setSingleResponseHorizontalHeight(int $height) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$height

int

Height between 1 and 100mm

Get the height of responses in a sub question matrix

getSingleResponseHorizontalHeight() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

string

Height in mm between 1 and 100

Set vertical height of a single response item

setSingleResponseAreaHeight(int $height) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$height

int

Height between 1 and 100mm

Get vertical height of a single response item

getSingleResponseAreaHeight() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

string

Height in mm between 1 and 100

Set background colour for a question

setBackgroundColourQuestion(int $colour) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$colour

int

Background colour between 0 and 255

Get background colour for a question

getBackgroundColourQuestion() : int
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

int

Background colour between 0 and 255

Set background colour for a section

setBackgroundColourSection(int $colour) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$colour

int

Background colour between 0 and 255

Get background colour for a section

getBackgroundColourSection() : int
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

int

Background colour between 0 and 255

Set allow splitting

setAllowSplittingSingleChoiceVertical(bool $allow = true) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$allow

bool

Whether to allow or not (default true)

Get allow splitting

getAllowSplittingSingleChoiceVertical() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

bool

Whether to allow or not

Set allow splitting

setAllowSplittingSingleChoiceHorizontal(bool $allow = true) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$allow

bool

Whether to allow or not (default true)

Get allow splitting

getAllowSplittingSingleChoiceHorizontal() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

bool

Whether to allow or not

Set allow splitting

setAllowSplittingVas(bool $allow = true) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$allow

bool

Whether to allow or not (default true)

Get allow splitting

getAllowSplittingVas() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

bool

Whether to allow or not

Set allow splitting

setAllowSplittingMatrixText(bool $allow = true) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$allow

bool

Whether to allow or not (default true)

Get allow splitting

getAllowSplittingMatrixText() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

bool

Whether to allow or not

Set allow splitting

setAllowSplittingResponses(bool $allow = true) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Arguments

$allow

bool

Whether to allow or not (default true)

Get allow splitting

getAllowSplittingResponses() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-25

Response

bool

Whether to allow or not

Set the minimum section height

setSectionHeight(int $height) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-07-30

Arguments

$height

int

The minimum height of a section

Get the section height

getSectionHeight() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-07-30

Response

string

section height

Get the response label font sizes normal

getResponseLabelFontSize() : resource
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Response

resource

font size

Set the response label normal font size

setResponseLabelFontSize($normalsize) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Arguments

$normalsize

Set the response label small font size

setResponseLabelFontSizeSmall($smallsize) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Arguments

$smallsize

Get the response label font size small

getResponseLabelFontSizeSmall() : resource
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Response

resource

font size

Get the response text font size

getResponseTextFontSize() : resource
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Response

resource

The response text font size

Set the response text font size

setResponseTextFontSize(int $size) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Arguments

$size

int

Get the style without any HTML/etc formatting

getStyle() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Response

string

The style without HTML or tabs

Set the CSS styling of some questionnaire elements

setStyle(string $style) : \none
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-04-10

Arguments

$style

string

The CSS styling of some questionnire elements

Response

\none

Set whether to use corner lines

setCornerLines() : \none
author

Adam Zammit adam.zammit@acspri.org.au

since 2014-12-22

Response

\none

Set whether to use corner boxes

setCornerBoxes() : \none
author

Adam Zammit adam.zammit@acspri.org.au

since 2014-12-22

Response

\none

Wrapper function for setCornerBoxes and setCornerLines methods

setEdgeDetectionFormat(\type $format) : \none
author

A A D V S Abeysinghe venura@acspri.org.au

since 2015-07-08

Arguments

$format

\type

lines or boxes

Response

\none

Get whether to use corner lines

getCornerLines() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2014-12-22

Response

bool

whether to use corner lines

Get whether to use corner boxes

getCornerBoxes() : bool
author

Adam Zammit adam.zammit@acspri.org.au

since 2014-12-22

Response

bool

whether to use corner boxes

Wrapper function for getCornerBoxes and getCornerLines methods

getEdgeDetectionFormat() : string
author

A A D V S Abeysinghe venura@acspri.org.au

since 2015-07-08

Response

string

whether to use corner lines or boxes

Get page format

getPageFormat() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2015-06-19

Response

string

page format

Set page format

setPageFormat(string $format, $orientation = '') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2015-06-19

Arguments

$format

string

page format

$orientation

Get page orientation

getPageOrientation() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2015-06-19

Response

string

page orientation

Set page orientation

setPageOrientation(string $orientation, $autopagebreak = '', $bottommargin = '') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2015-06-19

Arguments

$orientation

string

page orientation

$autopagebreak

$bottommargin

Export the layout as an XML file

getLayout() : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-20

Response

string

The XML layout in queXF Banding XML format

Set font size and style

setDefaultFont(integer $size = 12, string $style = '') : \TODO
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-11-05

Arguments

$size

integer

Optional, defaults to 12

$style

string

Optional, defaults to ''.

Response

\TODO

Initialise TCPDF width some default values and embedded fonts

init() : \TODO
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-20

Response

\TODO

Override of TCPDF Header function to blank

Header() 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-20

Set the background wash of the page

setBackground(string $type = 'empty') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-02

Arguments

$type

string

Optional, defaults to 'empty'.

getMainPageX

getMainPageX() 

The X coordinate of the start of the column

getColumnX() : double
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-05-30

Response

double

The X coordinate of the start of the current column

The width of the writeable page

getMainPageWidth() : double
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-02

Response

double

The width of the writeable page

The width of the writable column

getColumnWidth() : double
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-05-30

Response

double

The width of the current column

Draw a horizontal response box with possible eye guides and arrows

drawHorizontalResponseBox(int $x, int $y, string $position = 'only', bool $downarrow = false, bool $rightarrow = false, bool $smallwidth = false, bool $filled = false) 

Arguments

$x

int

The x position of the box area (top left)

$y

int

The y position of the box area (top left)

$position

string

What position the box is in for the eye guides

$downarrow

bool

Draw a down arrow?

$rightarrow

bool

Draw an arrow to the right?

$smallwidth

bool

Whether or not to use the small width

$filled

bool

Whether or not to have the box pre-filled

Draw a vertical response box with possible eye guides and arrows

drawVerticalResponseBox(int $x, int $y, string $position = 'only', bool $downarrow = false, bool $rightarrow = false, bool $filled = false) 

Arguments

$x

int

The x position of the box area (top left)

$y

int

The y position of the box area (top left)

$position

string

What position the box is in for the eye guides

$downarrow

bool

Draw a down arrow?

$rightarrow

bool

Draw an arrow to the right?

$filled

bool

Whether or not to have the box pre-filled

Return capital letter(s) corresponding to the given number

numberToLetter(integer $number) : string
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-08

Arguments

$number

integer

Response

string

Letter(s) corresponding to the number

Get the questionnaire id

getQuestionnaireId() : int
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-23

Response

int

The questionnaire Id

Converts a queXML file to the array format required for the create function

createqueXML(string $quexml) : array
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-08
see \create

Arguments

$quexml

string

The queXML file

Response

array

An array readable by create

Create a queXML PDF document based on an array that is structured like a queXML document

create(array $questionnaire) 

sections (title, text, info) questions (title, text, varname, helptext, helptextafter) responses (varname) subquestion (text, varname) response (type, width, text, rotate) categories (text, value)

Arguments

$questionnaire

array

The questionnaire in the array format above

Import the settings/styles set from XML

importStyleXML($xmlsettings) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2015-06-18

Arguments

$xmlsettings

Export the settings/styles set in XML

exportStyleXML() 
author

Adam Zammit adam.zammit@acspri.org.au

since 2015-06-18

Draw the questionnaire info specified

drawInfo($info) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2011-12-21

Arguments

$info

Create a question that may have multiple response groups

createQuestion(array $question) 

questions (title, text, specifier, helptext, helptextafter) responses (varname) subquestions subquestion(text, varname) response (type, width, text, rotate) categories category(text, value, skipto, other)

see \create

Arguments

$question

array

The questions portion of the array

Draw text responses line by line

drawMatrixTextVertical(array $subquestions, int $width, string|bool $parenttext = false, int $bgtype = 3, string|bool $responsegrouplabel = false, string|bool $split = 'notset') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-02

Arguments

$subquestions

array

The subquestions containing text and varname

$width

int

The width of the text element

$parenttext

string|bool

The question text of the parent or false if not specified

$bgtype

int

The box group type (default is 3 - text)

$responsegrouplabel

string|bool

The label for this response group or false if not specified

$split

string|bool

Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting

Draw a barcode as a "question"

drawMatrixBarcode(string $subquestions, string $type) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-06-22

Arguments

$subquestions

string

$type

string

Draw multiple VAS items

drawMatrixVas(array $subquestions, string|bool $parenttext = false, string $labelleft, string $labelright, string|bool $split = 'notset') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-20

Arguments

$subquestions

array

The subquestions containing text and varname

$parenttext

string|bool

The question text of the parent or false if not specified

$labelleft

string

The left hand side label

$labelright

string

The right hand side label

$split

string|bool

Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting

Draw a large empty box for writing in text

drawLongText(mixed $width, bool|string $defaultvalue = false, bool|string $text = false) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-02

Arguments

$width

mixed

The "width" of the box. This relates to the number of "lines" high

$defaultvalue

bool|string

The default text to print in the box (if any)

$text

bool|string

The text to display above the box (if any)

Draw a VAS

drawVas(string $text, string $labelleft, string $labelright, bool $heading = true) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-20

Arguments

$text

string

The text of this item

$labelleft

string

The left hand side label

$labelright

string

The right hand side label

$heading

bool

Whether to draw a heading or not

Draw a text response

drawText(string $text, int $width, bool|string $defaultvalue = false) 

Arguments

$text

string

The text label if any (can be HTML)

$width

int

The number of boxes to draw

$defaultvalue

bool|string

The default text to include or false if none

Draw X number of cells at the current X Y position

drawCells(int $cells, string $string) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-08

Arguments

$cells

int

The number of text cells to draw

$string

string

A string to draw if set

Draw a horizontal table of text boxes

drawMatrixTextHorizontal(array $subquestions, int $width, string|bool $parenttext = false, int $bgtype = 3, string|bool $responsegrouplabel = false) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-08

Arguments

$subquestions

array

The subquestions

$width

int

The width

$parenttext

string|bool

The question text of the parent or false if not specified

$bgtype

int

The type of the box group (defaults to 3 - text)

$responsegrouplabel

string|bool

The label for this response group or false if not specified

Draw the head of a single choice horizontal table of responses

drawSingleChoiceHorizontalHead(array $categories, string|bool $responsegrouplabel = false) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-06-05

Arguments

$categories

array

The response categories

$responsegrouplabel

string|bool

The label for this response group or false if not specified

Draw a horizontal table of respones including "eye guides"

drawSingleChoiceHorizontal(array $categories, array $subquestions = array(array('text' => '')), string|bool $parenttext = false, string|bool $responsegrouplabel = false, string|bool $split = "notset") 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-08

Arguments

$categories

array

The response categories

$subquestions

array

The subquestions if any

$parenttext

string|bool

The question text of the parent or false if not specified

$responsegrouplabel

string|bool

The label for this response group or false if not specified

$split

string|bool

Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting

Draw vertical questions separately instead of in a matrix

drawSingleChoiceVerticalSeparate(array $categories, array $subquestions, string|bool $parenttext, string|bool $help, string|bool $split = 'notset') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-07-30

Arguments

$categories

array

An array containing the category text, value, skipto and other

$subquestions

array

An array containing the subquestions if any

$parenttext

string|bool

The question text of the parent or false if not specified

$help

string|bool

Help text if any for the responses

$split

string|bool

Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting

Draw the head of a single choice vertical table of responses

drawSingleChoiceVerticalHead(array $subquestions) 
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-10-24

Arguments

$subquestions

array

The subquestions

Draw a vertical table of single choice responses including "eye guides"

drawSingleChoiceVertical(array $categories, array $subquestions = array(array('text' => '')), string|bool $parenttext = false, string|bool $split = 'notset') 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-02

Arguments

$categories

array

An array containing the category text, value, skipto and other

$subquestions

array

An array containing the subquestions if any

$parenttext

string|bool

The question text of the parent or false if not specified

$split

string|bool

Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting

Draw an "other" box

drawOther(array $other) : \TODO
author

Adam Zammit adam.zammit@acspri.org.au

since 2013-05-01

Arguments

$other

array

An array continaing varname,text,width,defaultvalue

Response

\TODO

Draw the header of a question (question title, text and help text if any)

drawQuestionHead(string $title, string $text, string|bool $help = false, string|bool $specifier = false) 

Arguments

$title

string

The question title (number)

$text

string

The question text (can be HTML)

$help

string|bool

The question help text or false if none (can be HTML)

$specifier

string|bool

The question specifier text or false if none (can be HTML)

Add a new section to the page

addSection(string $desc = 'queXMLPDF Section', $title = false, string $info = false) 

Arguments

$desc

string

The description of this section

$title

$info

string

Information for this section

Convert mm to pixels based on the set ppi (dpi)

mm2px(float $mm) : double

Arguments

$mm

float

Measurement in millimetres

Response

double

Pixel value as an integer

Make sure to fill the remaining columns on the last page

fillLastPageBackground() 
author

Adam Zammit adam.zammit@acspri.org.au

since 2012-05-31

Draw the background from the current Y position to the bottom of the page

fillPageBackground() 
author

Adam Zammit adam.zammit@acspri.org.au

since 2010-09-15

Create a new queXML PDF page

newPage($init = false) 

Draw the barcode and page corners

Arguments

$init

Override of the acceptPageBreak function

AcceptPageBreak() 

Allow our page handling function to know that a page break has occured

$return bool Returns false so no page break is automatically issued

Set _config for pdf

setConfig(mixed $tcpdf) 
inherited
access

public

Arguments

$tcpdf

mixed

Initialize and configure TCPDF with the settings in our config file

__construct() 
inherited

obsolete

intopdf(string $text, mixed $format = '') : \unknown_type
inherited

Arguments

$text

string

$format

mixed

Response

\unknown_type

obsolete

helptextintopdf(mixed $text) : \unknown_type
inherited

Arguments

$text

mixed

Response

\unknown_type

writes a big title in the page + description

titleintopdf(mixed $title, mixed $description = '') : \unknown_type
inherited

Arguments

$title

mixed

$description

mixed

Response

\unknown_type

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

tablehead($array) : \unknown_type
inherited

Arguments

$array

Response

\unknown_type

Creates a Table with equal cell width.

equalTable(mixed $array, mixed $modulo = 1) : \unknown_type
inherited

Arguments

$array

mixed

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

$modulo

mixed

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

Response

\unknown_type

creates a table using the full width of page

tableintopdf(mixed $array, mixed $modulo = 1) : \unknown_type
inherited

Arguments

$array

mixed

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

$modulo

mixed

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

Response

\unknown_type

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

headTable(mixed $head, mixed $table, mixed $modulo = 1) : \unknown_type
inherited

Arguments

$head

mixed

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

$table

mixed

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

$modulo

mixed

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

Response

\unknown_type

getminwidth

getminwidth($array) 
inherited

Arguments

$array

getmaxwidth

getmaxwidth($array) 
inherited

Arguments

$array

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

getFullWidth(mixed $array) : array
inherited

..

Arguments

$array

mixed

Response

array

with column width

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

getEqualWidth(mixed $array) : \unknown_type
inherited

Good for static tables with equal value String-length

Arguments

$array

mixed

Response

\unknown_type

write_out

write_out($name) 
inherited

Arguments

$name

delete_html

delete_html($text) 
inherited

Arguments

$text

Create Answer PDF document, set metadata and set title

initAnswerPDF(mixed $aSurveyInfo, mixed $aPdfLanguageSettings, mixed $sSiteName, mixed $sSurveyName, mixed $sDefaultHeaderString = '') : \unknown_type
inherited

Arguments

$aSurveyInfo

mixed

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

$aPdfLanguageSettings

mixed

  • Pdf language settings

$sSiteName

mixed

  • LimeSurvey site name (header and metadata)

$sSurveyName

mixed

  • Survey name (header, metadata and title),

$sDefaultHeaderString

mixed

  • TCPDF header string

Response

\unknown_type

Add title to pdf

addTitle(mixed $sTitle, mixed $sSubtitle = "") : \unknown_type
inherited

Arguments

$sTitle

mixed

  • Title

$sSubtitle

mixed

  • Subtitle

Response

\unknown_type

Add header to pdf

addHeader(mixed $aPdfLanguageSettings, mixed $sSiteName, mixed $sDefaultHeaderString) : \unknown_type
inherited

Arguments

$aPdfLanguageSettings

mixed

  • Pdf language settings

$sSiteName

mixed

  • LimeSurvey site name (header and metadata)

$sDefaultHeaderString

mixed

  • TCPDF header string

Response

\unknown_type

Add GID text to PDF

addGidAnswer(mixed $sGroupName, mixed $sGroupDescription, mixed $bAllowBreakPage = false) : \unknown_type
inherited

Arguments

$sGroupName

mixed

  • Group name

$sGroupDescription

mixed

  • Group description

$bAllowBreakPage

mixed

  • Allow break cell in two pages

Response

\unknown_type

Add answer to PDF

addAnswer(mixed $sQuestion, mixed $sResponse, mixed $bReplaceExpressions = true, mixed $bAllowBreakPage = false) : \unknown_type
inherited

Arguments

$sQuestion

mixed

  • Question field text array

$sResponse

mixed

  • Answer field text array

$bReplaceExpressions

mixed

  • 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

mixed

  • Allow break cell in two pages

Response

\unknown_type

Constants

Define an inch in MM

INCH_IN_MM
const

float Defaults to 25.4

Properties

Language for translation

language : 

Pixels per inch of exported document

ppi : int
var

Defaults to 300.

Type(s)

int

Whether a page break has occured Should be a private var but crash occurs on PHP 5.1.6, see Limesurvey Bug 5824

pageBreakOccured : bool
var

Type(s)

bool

Corner border (the number of mm between the edge of the page and the start of the document)

cornerBorder : int
var

Defaults to 15.

since

Type(s)

int

The length in MM of a corner line

cornerLength : mixed
var

Defaults to 20.

since

Type(s)

mixed

The width in MM of a corner line

cornerWidth : mixed
var

Defaults to 0.5.

since

Type(s)

mixed

The width in MM of a corner box 4.57mm is approx 54 pixels at 300dpi

cornerBoxWidth : float
var

Defaults to 4.57

since

Type(s)

float

The TCPDF barcode type

barcodeType : bool
var

Defaults to 'I25'.

since
see

Type(s)

bool

The distance between the right hand page border and the end of the barcode in MM

barcodeMarginX : bool
var

Defaults to 23.

since

Type(s)

bool

Y position of barcode in mm

barcodeY : bool
var

Defaults to 6.

since

Type(s)

bool

Width of the barcode in mm

barcodeW : bool
var

Defaults to 49.

since

Type(s)

bool

Height of the barcode in mm

barcodeH : bool
var

Defaults to 6.

since

Type(s)

bool

The questionnaire ID of this form

questionnaireId : mixed
var

Defaults to 1.

since

Type(s)

mixed

The length of a the id portion barcode

idLength : int
var

Defaults to 6.

since
see

Type(s)

int

The length of the page portion of the barcode

pageLength : mixed
var

Defaults to 2.

since
see

Type(s)

mixed

width of the question title column in MM

questionTitleWidth : mixed
var

Defaults to 14.

since

Type(s)

mixed

The suffix of the question title. i.e. A15. (the . is the suffix)

questionTitleSuffix : mixed
var

Defaults to ".".

since

Type(s)

mixed

Right margin of question text in MM

questionTextRightMargin : mixed
var

Defaults to 40.

since
see

Type(s)

mixed

Height of the border between questions in MM

questionBorderBottom : mixed
var

Defaults to 1.

since

Type(s)

mixed

Border after a help before directive

helpBeforeBorderBottom : mixed
var

Defaults to 3.

since

Type(s)

mixed

Border before a help before directive

helpBeforeBorderTop : mixed
var

Defaults to 3.

since

Type(s)

mixed

Width of the skip column area (where skip text is written)

skipColumnWidth : string
var

Defaults to 20.

since

Type(s)

string

The default style for the text of the questionnaire

style : string
var

Defaults to "".

since

Type(s)

string

Width of the area of each single response

singleResponseHorizontalHeight : string
var

Defaults to 10.

Defaults to 10.5.

since

Height of the area of a single response where displayed horizontally

Type(s)

string

The maximum number of lines of text to display in a horizontal single response before adding additional space

singleResponseHorizontalMaxLines : string
var

Defaults to 2.

since
see

Type(s)

string

Height of the are of each single response (includes guiding lines)

singleResponseAreaHeight : string
var

Defaults to 9.

since

Type(s)

string

Width of a single response box

singleResponseBoxWidth : string
var

Defaults to 5.

since

Type(s)

string

Height of a single response box

singleResponseBoxHeight : string
var

Defaults to 5.

since

Type(s)

string

Width of a response boxes border

singleResponseBoxBorder : string
var

Defaults to 0.1.

since

Type(s)

string

Length of the "eye guide" for a vertical response box

singleResponseBoxLineLength : string
var

Defaults to 1.

since

Type(s)

string

Vertical area taken up by a response box

singleResponseVerticalAreaWidth : string
var

Defaults to 15.

since

Type(s)

string

Vertical area taken up by a "small" vertical response area

singleResponseVerticalAreaWidthSmall : string
var

Defaults to 9.

since

Type(s)

string

Maximum number of horizontal boxes to display normally before shrinking horizontal area width

singleResponseHorizontalMax : int
var

Defaults to 10.

since

Type(s)

int

Allows all single choice horizontal arrays to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML

allowSplittingSingleChoiceHorizontal : bool
var

Defaults to false.

since

Type(s)

bool

Allows all single choice vertical arrays to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML

allowSplittingSingleChoiceVertical : bool
var

Defaults to false.

since

Type(s)

bool

If splitting is allowed for single choice vertical, only split if there is at least these many categories

minSplittingSingleChoiceVertical : int
var

Defaults to 5.

since

Type(s)

int

Allows multiple responses to the same question to be split over multiple pages/columns Can override with "split" attribute on "question" in queXML

allowSplittingResponses : bool
var

Defaults to false.

since

Type(s)

bool

Allows vertical matrix texts to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML

allowSplittingMatrixText : bool
var

Defaults to false.

since

Type(s)

bool

Allows matrix VAS items to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML

allowSplittingVas : bool
var

Defaults to false.

since

Type(s)

bool

The height of an arrow

arrowHeight : array
var

Defaults to 3.

since

Type(s)

array

The width of a text response box

textResponseWidth : mixed
var

Defaults to 6.

since

Type(s)

mixed

The border width of a text response box

textResponseBorder : mixed
var

Defaults to 0.15. Any less than this may produce printing problems

since

Type(s)

mixed

The height of a text response box

textResponseHeight : mixed
var

Defaults to 8.

since

Type(s)

mixed

The height of a pre-filled response barcode

barcodeResponseHeight : bool
var

Defaults to 6.

since

Type(s)

bool

The left hand margin of text responses to auto calculate responses per line (mm)

textResponseMarginX : mixed
var

Defaults to 13.

since

Type(s)

mixed

The left hand margin of text responses to auto calculated responses per line where the label should appear on the same line (mm)

labelTextResponsesSameLineMarginX : mixed
var

Defaults to 62.

since

Type(s)

mixed

The gap between multi line text responses

textResponseLineSpacing : mixed
var

Defaults to 1.

since

Type(s)

mixed

The vertical gap between subquestions in mm

subQuestionLineSpacing : string
var

Defaults to 2.

since

Type(s)

string

The multiplier from long text response width specified to the height in mm

longTextResponseHeightMultiplier : mixed
var

Defaults to 1.

since

Type(s)

mixed

Default number of characters to store in a long text field

longTextStorageWidth : int
var

Default is 1024;

since

Type(s)

int

The number of columns to display the sections/questions in on each page

columns : int
var

Defaults to 1.

since

Type(s)

int

The width of the border between columns

columnBorder : int
var

Defaults to 1.

since

Type(s)

int

The layout of the form for importing in to queXF

layout : array
var

Defaults to empty array

link

http://quexf.sourceforge.net/

Type(s)

array

Array to store section information for layout

section : array
var

Defaults to empty array

since

Type(s)

array

An array of key: skip target, value: last originating question that skips to the target

skipToRegistry : string
var

Defaults to array().

since

Type(s)

string

Page counter pointer (links to barcode id of page)

layoutCP : mixed
var

Defaults to "".

since

Type(s)

mixed

Section counter pointer

sectionCP : string
var

Defaults to 0.

since

Type(s)

string

Box group counter pointer

boxGroupCP : bool
var

Defaults to 0.

since

Type(s)

bool

Box counter pointer

boxCP : int
var

Defaults to 0.

Type(s)

int

Column counter pointer (current column)

columnCP : mixed
var

Defaults to 0.

since

Type(s)

mixed

Background colour of a question

backgroundColourQuestion : bool
var

Defaults to array(220,220,220).

since

Type(s)

bool

The bacground colour of a section

backgroundColourSection : bool
var

Defaults to array(200,200,200).

since

Type(s)

bool

Empty background colour

backgroundColourEmpty : bool
var

Defaults to array(255,255,255).

since

Type(s)

bool

The colour of a line/fill

lineColour : mixed
var

Defaults to array(0,0,0).

since

Type(s)

mixed

Text colour in grayscale

textColour : mixed
var

Defaults to 0.

since

Type(s)

mixed

The text to display before a skip

skipToText : string
var

Defaults to "Skip to ".

since

Type(s)

string

Should fonts be embedded in the document?

embedFonts : mixed
var

Defaults to true.

since

Type(s)

mixed

Height in MM of a VAS response

vasAreaHeight : mixed
var

Defaults to 8.

since

Type(s)

mixed

Width of a VAS line

vasLineWidth : mixed
var

Defaults to 0.5.

since

Type(s)

mixed

The width of a line for the default value

defaultValueLineWidth : double
var

Defaults to 0.5.

since

Type(s)

double

Height of the VAS ending lines in mm

vasHeight : mixed
var

Defaults to 4.

since

Type(s)

mixed

Length of the vas line itself

vasLength : mixed
var

Defaults to 100.

since

Type(s)

mixed

The number of increments stored on a vas line

vasIncrements : mixed
var

Defaults to 100.

since

Type(s)

mixed

The text to separate parent text and subquestion text

subQuestionTextSeparator : string
var

Defaults to " : ".

since

Type(s)

string

The top margin for questionnaireInfo section

questionnaireInfoMargin : mixed
var

Defaults to 5.

since

Type(s)

mixed

Height of a response label

responseLabelHeight : resource
var

Defaults to 10.

since

Type(s)

resource

Font size for response label

responseLabelFontSize : resource
var

Defaults to 8.

since

Type(s)

resource

A smaller font size for response labels where otherwise will break the line

responseLabelFontSizeSmall : resource
var

Defaults to 6.

since

Type(s)

resource

Reduce the font size of a response label if any words are longer than this

responseLabelSmallWordLength : resource
var

Defaults to 7.

since

Type(s)

resource

Font size for response text

responseTextFontSize : resource
var

Defaults to 10.

since

Type(s)

resource

Font size of the skip to text

skipToTextFontSize : string
var

Defaults to 8.

since

Type(s)

string

Default font

defaultFont : string
var

Defaults to 'freeserif'.

since

Type(s)

string

Height of a section break in mm

sectionHeight : string
var

Defaults to 18.

since

Type(s)

string

Use corner lines (default) or corner boxes

cornerLines : bool
var

Defaults to true

since

Type(s)

bool

TCPDF system constants that map to settings in our config file

cfg_constant_map : array
inherited
var
access

private

Type(s)

array

Settings from our APPPATH/config/tcpdf.php file

_config : array
inherited
var
access

private

Type(s)

array

Base font size for answer PDF export

_ibaseAnswerFontSize : int
inherited
var
access

private

Type(s)

int

Cell height for answer PDF export

_iCellHeight : int
inherited
var
access

private

Type(s)

int

Survey Information (preventing from passing to methods every time)

_aSurveyInfo : array
inherited
var
access

private

Type(s)

array