quexmlpdf
extends pdf
in package
A TCPDF based class to produce queXF compatible questionnaire PDF files and banding description XML from queXML
Tags
Table of Contents
Constants
- INCH_IN_MM = 25.4
- Define an inch in MM
Properties
- $allowSplittingMatrixText : bool
- Allows vertical matrix texts to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
- $allowSplittingResponses : bool
- Allows multiple responses to the same question to be split over multiple pages/columns Can override with "split" attribute on "question" in queXML
- $allowSplittingSingleChoiceHorizontal : bool
- Allows all single choice horizontal arrays to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
- $allowSplittingSingleChoiceVertical : bool
- Allows all single choice vertical arrays to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
- $allowSplittingVas : bool
- Allows matrix VAS items to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
- $arrowHeight : array<string|int, mixed>
- The height of an arrow
- $backgroundColourEmpty : bool
- Empty background colour
- $backgroundColourQuestion : bool
- Background colour of a question
- $backgroundColourSection : bool
- The bacground colour of a section
- $barcodeH : bool
- Height of the barcode in mm
- $barcodeMarginX : bool
- The distance between the right hand page border and the end of the barcode in MM
- $barcodeResponseHeight : bool
- The height of a pre-filled response barcode
- $barcodeType : bool
- The TCPDF barcode type
- $barcodeW : bool
- Width of the barcode in mm
- $barcodeY : bool
- Y position of barcode in mm
- $boxCP : int
- Box counter pointer
- $boxGroupCP : bool
- Box group counter pointer
- $columnBorder : int
- The width of the border between columns
- $columnCP : mixed
- Column counter pointer (current column)
- $columns : int
- The number of columns to display the sections/questions in on each page
- $cornerBorder : int
- Corner border (the number of mm between the edge of the page and the start of the document)
- $cornerBoxWidth : float
- The width in MM of a corner box 4.57mm is approx 54 pixels at 300dpi
- $cornerLength : mixed
- The length in MM of a corner line
- $cornerLines : bool
- Use corner lines (default) or corner boxes
- $cornerWidth : mixed
- The width in MM of a corner line
- $defaultFont : string
- Default font
- $defaultValueLineWidth : float
- The width of a line for the default value
- $embedFonts : mixed
- Should fonts be embedded in the document?
- $helpBeforeBorderBottom : mixed
- Border after a help before directive
- $helpBeforeBorderTop : mixed
- Border before a help before directive
- $idLength : int
- The length of a the id portion barcode
- $labelTextResponsesSameLineMarginX : mixed
- The left hand margin of text responses to auto calculated responses per line where the label should appear on the same line (mm)
- $language : mixed
- Language for translation
- $layout : array<string|int, mixed>
- The layout of the form for importing in to queXF
- $layoutCP : mixed
- Page counter pointer (links to barcode id of page)
- $lineColour : mixed
- The colour of a line/fill
- $longTextResponseHeightMultiplier : mixed
- The multiplier from long text response width specified to the height in mm
- $longTextStorageWidth : int
- Default number of characters to store in a long text field
- $minSplittingSingleChoiceVertical : int
- If splitting is allowed for single choice vertical, only split if there is at least these many categories
- $pageBreakOccured : bool
- Whether a page break has occurred Should be a private var but crash occurs on PHP 5.1.6, see Limesurvey Bug 5824
- $pageLength : mixed
- The length of the page portion of the barcode
- $ppi : int
- Pixels per inch of exported document
- $questionBorderBottom : mixed
- Height of the border between questions in MM
- $questionnaireId : mixed
- The questionnaire ID of this form
- $questionnaireInfoMargin : mixed
- The top margin for questionnaireInfo section
- $questionTextRightMargin : mixed
- Right margin of question text in MM
- $questionTitleSuffix : mixed
- The suffix of the question title. i.e. A15. (the . is the suffix)
- $questionTitleWidth : mixed
- width of the question title column in MM
- $responseLabelFontSize : resource
- Font size for response label
- $responseLabelFontSizeSmall : resource
- A smaller font size for response labels where otherwise will break the line
- $responseLabelHeight : resource
- Height of a response label
- $responseLabelSmallWordLength : resource
- Reduce the font size of a response label if any words are longer than this
- $responseTextFontSize : resource
- Font size for response text
- $section : array<string|int, mixed>
- Array to store section information for layout
- $sectionCP : string
- Section counter pointer
- $sectionHeight : string
- Height of a section break in mm
- $singleResponseAreaHeight : string
- Height of the are of each single response (includes guiding lines)
- $singleResponseBoxBorder : string
- Width of a response boxes border
- $singleResponseBoxHeight : string
- Height of a single response box
- $singleResponseBoxLineLength : string
- Length of the "eye guide" for a vertical response box
- $singleResponseBoxWidth : string
- Width of a single response box
- $singleResponseHorizontalHeight : string
- Width of the area of each single response
- $singleResponseHorizontalMax : int
- Maximum number of horizontal boxes to display normally before shrinking horizontal area width
- $singleResponseHorizontalMaxLines : string
- The maximum number of lines of text to display in a horizontal single response before adding additional space
- $singleResponseVerticalAreaWidth : string
- Vertical area taken up by a response box
- $singleResponseVerticalAreaWidthSmall : string
- Vertical area taken up by a "small" vertical response area
- $skipColumnWidth : string
- Width of the skip column area (where skip text is written)
- $skipToRegistry : string
- An array of key: skip target, value: last originating question that skips to the target
- $skipToText : string
- The text to display before a skip
- $skipToTextFontSize : string
- Font size of the skip to text
- $style : string
- The default style for the text of the questionnaire
- $subQuestionLineSpacing : string
- The vertical gap between subquestions in mm
- $subQuestionTextSeparator : string
- The text to separate parent text and subquestion text
- $textColour : mixed
- Text colour in grayscale
- $textResponseBorder : mixed
- The border width of a text response box
- $textResponseHeight : mixed
- The height of a text response box
- $textResponseLineSpacing : mixed
- The gap between multi line text responses
- $textResponseMarginX : mixed
- The left hand margin of text responses to auto calculate responses per line (mm)
- $textResponseWidth : mixed
- The width of a text response box
- $vasAreaHeight : mixed
- Height in MM of a VAS response
- $vasHeight : mixed
- Height of the VAS ending lines in mm
- $vasIncrements : mixed
- The number of increments stored on a vas line
- $vasLength : mixed
- Length of the vas line itself
- $vasLineWidth : mixed
- Width of a VAS line
- $_aSurveyInfo : array<string|int, mixed>
- Survey Information (preventing from passing to methods every time)
- $_config : array<string|int, mixed>
- Settings from our APPPATH/config/tcpdf.php file
- $_ibaseAnswerFontSize : int
- Base font size for answer PDF export
- $_iCellHeight : int
- Cell height for answer PDF export
- $cfg_constant_map : array<string|int, mixed>
- TCPDF system constants that map to settings in our config file
Methods
- __construct() : mixed
- Initialize from config
- _quexmlsettings() : array<string|int, string>
- Return a list of queXML settings
- AcceptPageBreak() : mixed
- Override of the acceptPageBreak function
- addAnswer() : void
- Add answer to PDF
- addGidAnswer() : void
- Add GID text to PDF
- addHeader() : void
- Add header to pdf
- addTitle() : void
- Add title to pdf
- applyGlobalSettings() : mixed
- Apply global settings from LimeSurvey application
- create() : mixed
- Create a queXML PDF document based on an array that is structured like a queXML document
- createqueXML() : array<string|int, mixed>
- Converts a queXML file to the array format required for the create function
- delete_html() : mixed
- equalTable() : void
- Creates a Table with equal cell width.
- exportStyleXML() : mixed
- Export the settings/styles set in XML
- Footer() : mixed
- Override of TCPDF Footer function to blank
- getAllowSplittingMatrixText() : bool
- Get allow splitting
- getAllowSplittingResponses() : bool
- Get allow splitting
- getAllowSplittingSingleChoiceHorizontal() : bool
- Get allow splitting
- getAllowSplittingSingleChoiceVertical() : bool
- Get allow splitting
- getAllowSplittingVas() : bool
- Get allow splitting
- getBackgroundColourQuestion() : int
- Get background colour for a question
- getBackgroundColourSection() : int
- Get background colour for a section
- getCornerBoxes() : bool
- Get whether to use corner boxes
- getCornerLines() : bool
- Get whether to use corner lines
- getEdgeDetectionFormat() : string
- Wrapper function for getCornerBoxes and getCornerLines methods
- getEqualWidth() : mixed
- gets the width for each column in tables, based on pagewidth and count of columns.
- getFullWidth() : array<string|int, mixed>
- Gets the width for columns in a table based on their Stringlength and the width of the page.
- getLayout() : string
- Export the layout as an XML file
- getmaxwidth() : mixed
- getminwidth() : mixed
- getPageFormat() : string
- Get page format
- getPageOrientation() : string
- Get page orientation
- getQuestionnaireId() : int
- Get the questionnaire id
- getQuestionnaireInfoMargin() : int
- Get the margin before questionnaire info
- getResponseLabelFontSize() : resource
- Get the response label font sizes normal
- getResponseLabelFontSizeSmall() : resource
- Get the response label font size small
- getResponseTextFontSize() : resource
- Get the response text font size
- getSectionHeight() : string
- Get the section height
- getSingleResponseAreaHeight() : string
- Get vertical height of a single response item
- getSingleResponseHorizontalHeight() : string
- Get the height of responses in a sub question matrix
- getStyle() : string
- Get the style without any HTML/etc formatting
- Header() : mixed
- Override of TCPDF Header function to blank
- headTable() : void
- creates a table with a bold head using the full width of page
- importStyleXML() : mixed
- Import the settings/styles set from XML
- initAnswerPDF() : void
- Create Answer PDF document, set metadata and set title
- intopdf() : void
- mm2px() : float
- Convert mm to pixels based on the set ppi (dpi)
- numberToLetter() : string
- Return capital letter(s) corresponding to the given number
- setAllowSplittingMatrixText() : mixed
- Set allow splitting
- setAllowSplittingResponses() : mixed
- Set allow splitting
- setAllowSplittingSingleChoiceHorizontal() : mixed
- Set allow splitting
- setAllowSplittingSingleChoiceVertical() : mixed
- Set allow splitting
- setAllowSplittingVas() : mixed
- Set allow splitting
- setBackgroundColourQuestion() : mixed
- Set background colour for a question
- setBackgroundColourSection() : mixed
- Set background colour for a section
- setConfig() : mixed
- Set _config for pdf
- setCornerBoxes() : none
- Set whether to use corner boxes
- setCornerLines() : none
- Set whether to use corner lines
- setEdgeDetectionFormat() : none
- Wrapper function for setCornerBoxes and setCornerLines methods
- setLanguage() : mixed
- setPageFormat() : mixed
- Set page format
- setPageOrientation() : mixed
- Set page orientation
- setQuestionnaireInfoMargin() : mixed
- Set margin before questionnare info
- setResponseLabelFontSize() : mixed
- Set the response label normal font size
- setResponseLabelFontSizeSmall() : mixed
- Set the response label small font size
- setResponseTextFontSize() : mixed
- Set the response text font size
- setSectionHeight() : mixed
- Set the minimum section height
- setSingleResponseAreaHeight() : mixed
- Set vertical height of a single response item
- setSingleResponseHorizontalHeight() : mixed
- Set the height of responses items in a sub question matrix
- setStyle() : none
- Set the CSS styling of some questionnaire elements
- tablehead() : void
- Creates a Table with equal cell width and Bold text. Used as Head for equalTable()
- tableintopdf() : void
- Creates a table using the full width of page
- titleintopdf() : void
- Writes a big title in the page + description
- write_out() : mixed
- addBox() : mixed
- Add a box to the page layout system
- addBoxGroup() : mixed
- Add a box group to the page layout system
- addBoxGroupCopyPrevious() : mixed
- Add a new box group which is a copy of the previous one (if exists)
- addSection() : mixed
- Add a new section to the page
- createQuestion() : mixed
- Create a question that may have multiple response groups
- drawCells() : mixed
- Draw X number of cells at the current X Y position
- drawHorizontalResponseBox() : mixed
- Draw a horizontal response box with possible eye guides and arrows
- drawInfo() : mixed
- Draw the questionnaire info specified
- drawLongText() : mixed
- Draw a large empty box for writing in text
- drawMatrixBarcode() : mixed
- Draw a barcode as a "question"
- drawMatrixTextHorizontal() : mixed
- Draw a horizontal table of text boxes
- drawMatrixTextVertical() : mixed
- Draw text responses line by line
- drawMatrixVas() : mixed
- Draw multiple VAS items
- drawOther() : TODO
- Draw an "other" box
- drawQuestionHead() : mixed
- Draw the header of a question (question title, text and help text if any)
- drawSingleChoiceHorizontal() : mixed
- Draw a horizontal table of respones including "eye guides"
- drawSingleChoiceHorizontalHead() : mixed
- Draw the head of a single choice horizontal table of responses
- drawSingleChoiceVertical() : mixed
- Draw a vertical table of single choice responses including "eye guides"
- drawSingleChoiceVerticalHead() : mixed
- Draw the head of a single choice vertical table of responses
- drawSingleChoiceVerticalSeparate() : mixed
- Draw vertical questions separately instead of in a matrix
- drawText() : mixed
- Draw a text response
- drawVas() : mixed
- Draw a VAS
- drawVerticalResponseBox() : mixed
- Draw a vertical response box with possible eye guides and arrows
- fillLastPageBackground() : mixed
- Make sure to fill the remaining columns on the last page
- fillPageBackground() : mixed
- Draw the background from the current Y position to the bottom of the page
- getColumnWidth() : float
- The width of the writable column
- getColumnX() : float
- The X coordinate of the start of the column
- getMainPageWidth() : float
- The width of the writeable page
- getMainPageX() : mixed
- init() : TODO
- Initialise TCPDF width some default values and embedded fonts
- newPage() : mixed
- Create a new queXML PDF page
- setBackground() : mixed
- Set the background wash of the page
- setDefaultFont() : TODO
- Set font size and style
- wordLength() : int
- Return the length of the longest word
Constants
INCH_IN_MM
Define an inch in MM
public
mixed
INCH_IN_MM
= 25.4
Tags
Properties
$allowSplittingMatrixText
Allows vertical matrix texts to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
protected
bool
$allowSplittingMatrixText
= \true
Defaults to false.
Tags
$allowSplittingResponses
Allows multiple responses to the same question to be split over multiple pages/columns Can override with "split" attribute on "question" in queXML
protected
bool
$allowSplittingResponses
= \true
Defaults to false.
Tags
$allowSplittingSingleChoiceHorizontal
Allows all single choice horizontal arrays to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
protected
bool
$allowSplittingSingleChoiceHorizontal
= \true
Defaults to false.
Tags
$allowSplittingSingleChoiceVertical
Allows all single choice vertical arrays to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
protected
bool
$allowSplittingSingleChoiceVertical
= \true
Defaults to false.
Tags
$allowSplittingVas
Allows matrix VAS items to be split over multiple pages/columns Can override with "split" attribute on "response" in queXML
protected
bool
$allowSplittingVas
= \false
Defaults to false.
Tags
$arrowHeight
The height of an arrow
protected
array<string|int, mixed>
$arrowHeight
= 3
Defaults to 3.
Tags
$backgroundColourEmpty
Empty background colour
protected
bool
$backgroundColourEmpty
= array(255)
Defaults to array(255,255,255).
Tags
$backgroundColourQuestion
Background colour of a question
protected
bool
$backgroundColourQuestion
= array(241)
Defaults to array(220,220,220).
Tags
$backgroundColourSection
The bacground colour of a section
protected
bool
$backgroundColourSection
= array(221)
Defaults to array(200,200,200).
Tags
$barcodeH
Height of the barcode in mm
protected
bool
$barcodeH
= 6
Defaults to 6.
Tags
$barcodeMarginX
The distance between the right hand page border and the end of the barcode in MM
protected
bool
$barcodeMarginX
= 23
Defaults to 23.
Tags
$barcodeResponseHeight
The height of a pre-filled response barcode
protected
bool
$barcodeResponseHeight
= 6
Defaults to 6.
Tags
$barcodeType
The TCPDF barcode type
protected
bool
$barcodeType
= 'I25'
Defaults to 'I25'.
Tags
$barcodeW
Width of the barcode in mm
protected
bool
$barcodeW
= 49
Defaults to 49.
Tags
$barcodeY
Y position of barcode in mm
protected
bool
$barcodeY
= 6
Defaults to 6.
Tags
$boxCP
Box counter pointer
protected
int
$boxCP
= 0
Defaults to 0.
$boxGroupCP
Box group counter pointer
protected
bool
$boxGroupCP
= 0
Defaults to 0.
Tags
$columnBorder
The width of the border between columns
protected
int
$columnBorder
= 1
Defaults to 1.
Tags
$columnCP
Column counter pointer (current column)
protected
mixed
$columnCP
= 0
Defaults to 0.
Tags
$columns
The number of columns to display the sections/questions in on each page
protected
int
$columns
= 1
Defaults to 1.
Tags
$cornerBorder
Corner border (the number of mm between the edge of the page and the start of the document)
protected
int
$cornerBorder
= 14
Defaults to 15.
Tags
$cornerBoxWidth
The width in MM of a corner box 4.57mm is approx 54 pixels at 300dpi
protected
float
$cornerBoxWidth
= 4.57
Defaults to 4.57
Tags
$cornerLength
The length in MM of a corner line
protected
mixed
$cornerLength
= 20
Defaults to 20.
Tags
$cornerLines
Use corner lines (default) or corner boxes
protected
bool
$cornerLines
= \true
Defaults to true
Tags
$cornerWidth
The width in MM of a corner line
protected
mixed
$cornerWidth
= 0.5
Defaults to 0.5.
Tags
$defaultFont
Default font
protected
string
$defaultFont
= 'freeserif'
Defaults to 'freeserif'.
Tags
$defaultValueLineWidth
The width of a line for the default value
protected
float
$defaultValueLineWidth
= 0.5
Defaults to 0.5.
Tags
$embedFonts
Should fonts be embedded in the document?
protected
mixed
$embedFonts
= \true
Defaults to true.
Tags
$helpBeforeBorderBottom
Border after a help before directive
protected
mixed
$helpBeforeBorderBottom
= 3
Defaults to 3.
Tags
$helpBeforeBorderTop
Border before a help before directive
protected
mixed
$helpBeforeBorderTop
= 3
Defaults to 3.
Tags
$idLength
The length of a the id portion barcode
protected
int
$idLength
= 6
Defaults to 6.
Tags
$labelTextResponsesSameLineMarginX
The left hand margin of text responses to auto calculated responses per line where the label should appear on the same line (mm)
protected
mixed
$labelTextResponsesSameLineMarginX
= 62
Defaults to 62.
Tags
$language
Language for translation
protected
mixed
$language
= "en"
$layout
The layout of the form for importing in to queXF
protected
array<string|int, mixed>
$layout
= array()
Defaults to empty array
Tags
$layoutCP
Page counter pointer (links to barcode id of page)
protected
mixed
$layoutCP
= ""
Defaults to "".
Tags
$lineColour
The colour of a line/fill
protected
mixed
$lineColour
= array(0)
Defaults to array(0,0,0).
Tags
$longTextResponseHeightMultiplier
The multiplier from long text response width specified to the height in mm
protected
mixed
$longTextResponseHeightMultiplier
= 1
Defaults to 1.
Tags
$longTextStorageWidth
Default number of characters to store in a long text field
protected
int
$longTextStorageWidth
= 1024
Default is 1024;
Tags
$minSplittingSingleChoiceVertical
If splitting is allowed for single choice vertical, only split if there is at least these many categories
protected
int
$minSplittingSingleChoiceVertical
= 25
Defaults to 5.
Tags
$pageBreakOccured
Whether a page break has occurred Should be a private var but crash occurs on PHP 5.1.6, see Limesurvey Bug 5824
protected
bool
$pageBreakOccured
$pageLength
The length of the page portion of the barcode
protected
mixed
$pageLength
= 2
Defaults to 2.
Tags
$ppi
Pixels per inch of exported document
protected
int
$ppi
= 300
Defaults to 300.
$questionBorderBottom
Height of the border between questions in MM
protected
mixed
$questionBorderBottom
= 1
Defaults to 1.
Tags
$questionnaireId
The questionnaire ID of this form
protected
mixed
$questionnaireId
= 1
Defaults to 1.
Tags
$questionnaireInfoMargin
The top margin for questionnaireInfo section
protected
mixed
$questionnaireInfoMargin
= 5
Defaults to 5.
Tags
$questionTextRightMargin
Right margin of question text in MM
protected
mixed
$questionTextRightMargin
= 40
Defaults to 40.
Tags
$questionTitleSuffix
The suffix of the question title. i.e. A15. (the . is the suffix)
protected
mixed
$questionTitleSuffix
= "."
Defaults to ".".
Tags
$questionTitleWidth
width of the question title column in MM
protected
mixed
$questionTitleWidth
= 14
Defaults to 14.
Tags
$responseLabelFontSize
Font size for response label
protected
resource
$responseLabelFontSize
= 7.5
Defaults to 8.
Tags
$responseLabelFontSizeSmall
A smaller font size for response labels where otherwise will break the line
protected
resource
$responseLabelFontSizeSmall
= 6.5
Defaults to 6.
Tags
$responseLabelHeight
Height of a response label
protected
resource
$responseLabelHeight
= 10
Defaults to 10.
Tags
$responseLabelSmallWordLength
Reduce the font size of a response label if any words are longer than this
protected
resource
$responseLabelSmallWordLength
= 7
Defaults to 7.
Tags
$responseTextFontSize
Font size for response text
protected
resource
$responseTextFontSize
= 10
Defaults to 10.
Tags
$section
Array to store section information for layout
protected
array<string|int, mixed>
$section
= array()
Defaults to empty array
Tags
$sectionCP
Section counter pointer
protected
string
$sectionCP
= 0
Defaults to 0.
Tags
$sectionHeight
Height of a section break in mm
protected
string
$sectionHeight
= 18
Defaults to 18.
Tags
$singleResponseAreaHeight
Height of the are of each single response (includes guiding lines)
protected
string
$singleResponseAreaHeight
= 9
Defaults to 9.
Tags
$singleResponseBoxBorder
Width of a response boxes border
protected
string
$singleResponseBoxBorder
= 0.15
Defaults to 0.1.
Tags
$singleResponseBoxHeight
Height of a single response box
protected
string
$singleResponseBoxHeight
= 5
Defaults to 5.
Tags
$singleResponseBoxLineLength
Length of the "eye guide" for a vertical response box
protected
string
$singleResponseBoxLineLength
= 1
Defaults to 1.
Tags
$singleResponseBoxWidth
Width of a single response box
protected
string
$singleResponseBoxWidth
= 5
Defaults to 5.
Tags
$singleResponseHorizontalHeight
Width of the area of each single response
protected
string
$singleResponseHorizontalHeight
= 10.5
Defaults to 10.
Tags
$singleResponseHorizontalMax
Maximum number of horizontal boxes to display normally before shrinking horizontal area width
protected
int
$singleResponseHorizontalMax
= 10
Defaults to 10.
Tags
$singleResponseHorizontalMaxLines
The maximum number of lines of text to display in a horizontal single response before adding additional space
protected
string
$singleResponseHorizontalMaxLines
= 2
Defaults to 2.
Tags
$singleResponseVerticalAreaWidth
Vertical area taken up by a response box
protected
string
$singleResponseVerticalAreaWidth
= 13
Defaults to 15.
Tags
$singleResponseVerticalAreaWidthSmall
Vertical area taken up by a "small" vertical response area
protected
string
$singleResponseVerticalAreaWidthSmall
= 9
Defaults to 9.
Tags
$skipColumnWidth
Width of the skip column area (where skip text is written)
protected
string
$skipColumnWidth
= 20
Defaults to 20.
Tags
$skipToRegistry
An array of key: skip target, value: last originating question that skips to the target
protected
string
$skipToRegistry
= array()
Defaults to array().
Tags
$skipToText
The text to display before a skip
protected
string
$skipToText
= "Skip to "
Defaults to "Skip to ".
Tags
$skipToTextFontSize
Font size of the skip to text
protected
string
$skipToTextFontSize
= 8
Defaults to 8.
Tags
$style
The default style for the text of the questionnaire
protected
string
$style
= "<style>\n td.questionTitle {font-weight:bold; font-size:12pt;}\n td.questionTitleSkipTo {font-weight:bold; font-size:16pt;}\n td.questionText {font-weight:bold; font-size:12pt;}\n td.questionSpecifier {font-weight:normal; font-size:12pt;}\n td.vasLabel {font-weight:bold; font-size:10pt; text-align:center;}\n td.questionHelp {font-weight:normal; text-align:right; font-style:italic; font-size:8pt;}\n td.questionHelpAfter {text-align:center; font-weight:bold; font-size:10pt;}\n td.questionHelpBefore {text-align:center; font-weight:bold; font-size:12pt;}\n td.responseAboveText {font-weight:normal; font-style:normal; text-align:left; font-size:12pt;}\n td.matrixResponseGroupLabel {font-weight:normal; font-style:normal; text-align:left; font-size:12pt;}\n span.sectionTitle {font-size:18pt; font-weight:bold;}\n span.sectionDescription {font-size:14pt; font-weight:bold;}\n div.sectionInfo {font-style:normal; font-size:10pt; text-align:left; font-weight:normal;}\n td.questionnaireInfo {font-size:14pt; text-align:center; font-weight:bold;}\n </style>"
Defaults to "<style>td.questionHelp {text-align:right; font-style:italic; font-size: 8pt;} td.responseText {text-align:right; margin-right:1mm;} td.responseAboveText {text-align:left;} td.responseLabel {text-align:center; font-size:8pt;} span.sectionTitle {font-size: 18pt} span.sectionDescription {font-size: 14pt}</style>".
Tags
$subQuestionLineSpacing
The vertical gap between subquestions in mm
protected
string
$subQuestionLineSpacing
= 2
Defaults to 2.
Tags
$subQuestionTextSeparator
The text to separate parent text and subquestion text
protected
string
$subQuestionTextSeparator
= " : "
Defaults to " : ".
Tags
$textColour
Text colour in grayscale
protected
mixed
$textColour
= 0
Defaults to 0.
Tags
$textResponseBorder
The border width of a text response box
protected
mixed
$textResponseBorder
= 0.15
Defaults to 0.15. Any less than this may produce printing problems
Tags
$textResponseHeight
The height of a text response box
protected
mixed
$textResponseHeight
= 8
Defaults to 8.
Tags
$textResponseLineSpacing
The gap between multi line text responses
protected
mixed
$textResponseLineSpacing
= 1
Defaults to 1.
Tags
$textResponseMarginX
The left hand margin of text responses to auto calculate responses per line (mm)
protected
mixed
$textResponseMarginX
= 13
Defaults to 13.
Tags
$textResponseWidth
The width of a text response box
protected
mixed
$textResponseWidth
= 6
Defaults to 6.
Tags
$vasAreaHeight
Height in MM of a VAS response
protected
mixed
$vasAreaHeight
= 8
Defaults to 8.
Tags
$vasHeight
Height of the VAS ending lines in mm
protected
mixed
$vasHeight
= 4
Defaults to 4.
Tags
$vasIncrements
The number of increments stored on a vas line
protected
mixed
$vasIncrements
= 100
Defaults to 100.
Tags
$vasLength
Length of the vas line itself
protected
mixed
$vasLength
= 100
Defaults to 100.
Tags
$vasLineWidth
Width of a VAS line
protected
mixed
$vasLineWidth
= 0.5
Defaults to 0.5.
Tags
$_aSurveyInfo
Survey Information (preventing from passing to methods every time)
private
array<string|int, mixed>
$_aSurveyInfo
= array()
Tags
$_config
Settings from our APPPATH/config/tcpdf.php file
private
array<string|int, mixed>
$_config
= array()
Tags
$_ibaseAnswerFontSize
Base font size for answer PDF export
private
int
$_ibaseAnswerFontSize
= 12
Tags
$_iCellHeight
Cell height for answer PDF export
private
int
$_iCellHeight
= 6
Tags
$cfg_constant_map
TCPDF system constants that map to settings in our config file
private
array<string|int, mixed>
$cfg_constant_map
= array('K_PATH_MAIN' => 'base_directory', 'K_PATH_URL' => 'base_url', 'K_PATH_FONTS' => 'fonts_directory', 'K_PATH_CACHE' => 'cache_directory', 'K_PATH_IMAGES' => 'image_directory', 'K_BLANK_IMAGE' => 'blank_image', 'K_SMALL_RATIO' => 'small_font_ratio')
Tags
Methods
__construct()
Initialize from config
public
__construct() : mixed
_quexmlsettings()
Return a list of queXML settings
public
_quexmlsettings() : array<string|int, string>
Tags
Return values
array<string|int, string> —queXML settings
AcceptPageBreak()
Override of the acceptPageBreak function
public
AcceptPageBreak() : mixed
Allow our page handling function to know that a page break has occurred
$return bool Returns false so no page break is automatically issued
addAnswer()
Add answer to PDF
public
addAnswer(string $sQuestion, string $sResponse[, bool $bReplaceExpressions = true ][, bool $bAllowBreakPage = false ]) : void
Parameters
- $sQuestion : string
-
- Question field text array
- $sResponse : string
-
- Answer field text array
- $bReplaceExpressions : bool = true
-
- 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 : bool = false
-
- Allow break cell in two pages
addGidAnswer()
Add GID text to PDF
public
addGidAnswer( $sGroupName, string $sGroupDescription[, $bAllowBreakPage = false ]) : void
Parameters
addHeader()
Add header to pdf
public
addHeader(array<string|int, mixed> $aPdfLanguageSettings, string $sSiteName, string $sDefaultHeaderString) : void
Parameters
- $aPdfLanguageSettings : array<string|int, mixed>
-
- Pdf language settings
- $sSiteName : string
-
- LimeSurvey site name (header and metadata)
- $sDefaultHeaderString : string
-
- TCPDF header string
addTitle()
Add title to pdf
public
addTitle(string $sTitle[, string $sSubtitle = "" ]) : void
Parameters
- $sTitle : string
-
- Title
- $sSubtitle : string = ""
-
- Subtitle
applyGlobalSettings()
Apply global settings from LimeSurvey application
public
applyGlobalSettings() : mixed
create()
Create a queXML PDF document based on an array that is structured like a queXML document
public
create(array<string|int, mixed> $questionnaire) : mixed
sections (title, text, info) questions (title, text, varname, helptext, helptextafter) responses (varname) subquestion (text, varname) response (type, width, text, rotate) categories (text, value)
Parameters
- $questionnaire : array<string|int, mixed>
-
The questionnaire in the array format above
createqueXML()
Converts a queXML file to the array format required for the create function
public
createqueXML(string $quexml) : array<string|int, mixed>
Parameters
- $quexml : string
-
The queXML file
Tags
Return values
array<string|int, mixed> —An array readable by create
delete_html()
public
delete_html(mixed $text) : mixed
Parameters
- $text : mixed
equalTable()
Creates a Table with equal cell width.
public
equalTable( $array[, int $modulo = 1 ]) : void
Parameters
exportStyleXML()
Export the settings/styles set in XML
public
exportStyleXML() : mixed
Tags
Footer()
Override of TCPDF Footer function to blank
public
Footer() : mixed
Tags
getAllowSplittingMatrixText()
Get allow splitting
public
getAllowSplittingMatrixText() : bool
Tags
Return values
bool —Whether to allow or not
getAllowSplittingResponses()
Get allow splitting
public
getAllowSplittingResponses() : bool
Tags
Return values
bool —Whether to allow or not
getAllowSplittingSingleChoiceHorizontal()
Get allow splitting
public
getAllowSplittingSingleChoiceHorizontal() : bool
Tags
Return values
bool —Whether to allow or not
getAllowSplittingSingleChoiceVertical()
Get allow splitting
public
getAllowSplittingSingleChoiceVertical() : bool
Tags
Return values
bool —Whether to allow or not
getAllowSplittingVas()
Get allow splitting
public
getAllowSplittingVas() : bool
Tags
Return values
bool —Whether to allow or not
getBackgroundColourQuestion()
Get background colour for a question
public
getBackgroundColourQuestion() : int
Tags
Return values
int —Background colour between 0 and 255
getBackgroundColourSection()
Get background colour for a section
public
getBackgroundColourSection() : int
Tags
Return values
int —Background colour between 0 and 255
getCornerBoxes()
Get whether to use corner boxes
public
getCornerBoxes() : bool
Tags
Return values
bool —whether to use corner boxes
getCornerLines()
Get whether to use corner lines
public
getCornerLines() : bool
Tags
Return values
bool —whether to use corner lines
getEdgeDetectionFormat()
Wrapper function for getCornerBoxes and getCornerLines methods
public
getEdgeDetectionFormat() : string
Tags
Return values
string —whether to use corner lines or boxes
getEqualWidth()
gets the width for each column in tables, based on pagewidth and count of columns.
public
getEqualWidth( $array) : mixed
Good for static tables with equal value String-length
Parameters
getFullWidth()
Gets the width for columns in a table based on their Stringlength and the width of the page.
public
getFullWidth( $array) : array<string|int, mixed>
..
Parameters
Return values
array<string|int, mixed> —with column width
getLayout()
Export the layout as an XML file
public
getLayout() : string
Tags
Return values
string —The XML layout in queXF Banding XML format
getmaxwidth()
public
getmaxwidth(mixed $array) : mixed
Parameters
- $array : mixed
getminwidth()
public
getminwidth(mixed $array) : mixed
Parameters
- $array : mixed
getPageFormat()
Get page format
public
getPageFormat() : string
Tags
Return values
string —page format
getPageOrientation()
Get page orientation
public
getPageOrientation() : string
Tags
Return values
string —page orientation
getQuestionnaireId()
Get the questionnaire id
public
getQuestionnaireId() : int
Tags
Return values
int —The questionnaire Id
getQuestionnaireInfoMargin()
Get the margin before questionnaire info
public
getQuestionnaireInfoMargin() : int
Tags
Return values
int —Height in mm between 0 and 100
getResponseLabelFontSize()
Get the response label font sizes normal
public
getResponseLabelFontSize() : resource
Tags
Return values
resource —font size
getResponseLabelFontSizeSmall()
Get the response label font size small
public
getResponseLabelFontSizeSmall() : resource
Tags
Return values
resource —font size
getResponseTextFontSize()
Get the response text font size
public
getResponseTextFontSize() : resource
Tags
Return values
resource —The response text font size
getSectionHeight()
Get the section height
public
getSectionHeight() : string
Tags
Return values
string —section height
getSingleResponseAreaHeight()
Get vertical height of a single response item
public
getSingleResponseAreaHeight() : string
Tags
Return values
string —Height in mm between 1 and 100
getSingleResponseHorizontalHeight()
Get the height of responses in a sub question matrix
public
getSingleResponseHorizontalHeight() : string
Tags
Return values
string —Height in mm between 1 and 100
getStyle()
Get the style without any HTML/etc formatting
public
getStyle() : string
Tags
Return values
string —The style without HTML or tabs
Header()
Override of TCPDF Header function to blank
public
Header() : mixed
Tags
headTable()
creates a table with a bold head using the full width of page
public
headTable( $head, $table[, $modulo = 1 ]) : void
Parameters
importStyleXML()
Import the settings/styles set from XML
public
importStyleXML(mixed $xmlsettings) : mixed
Parameters
- $xmlsettings : mixed
Tags
initAnswerPDF()
Create Answer PDF document, set metadata and set title
public
initAnswerPDF(array<string|int, mixed> $aSurveyInfo, array<string|int, mixed> $aPdfLanguageSettings, string $sSiteName, string $sSurveyName[, string $sDefaultHeaderString = '' ]) : void
Parameters
- $aSurveyInfo : array<string|int, mixed>
-
- Survey Information (preventing from passing to methods every time)
- $aPdfLanguageSettings : array<string|int, mixed>
-
- 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()
public
intopdf(string $text[, $format = '' ]) : void
Parameters
Tags
mm2px()
Convert mm to pixels based on the set ppi (dpi)
public
mm2px(float $mm) : float
Parameters
- $mm : float
-
Measurement in millimetres
Return values
float —Pixel value as an integer
numberToLetter()
Return capital letter(s) corresponding to the given number
public
numberToLetter(int $number) : string
Parameters
- $number : int
Tags
Return values
string —Letter(s) corresponding to the number
setAllowSplittingMatrixText()
Set allow splitting
public
setAllowSplittingMatrixText([bool $allow = true ]) : mixed
Parameters
- $allow : bool = true
-
Whether to allow or not (default true)
Tags
setAllowSplittingResponses()
Set allow splitting
public
setAllowSplittingResponses([bool $allow = true ]) : mixed
Parameters
- $allow : bool = true
-
Whether to allow or not (default true)
Tags
setAllowSplittingSingleChoiceHorizontal()
Set allow splitting
public
setAllowSplittingSingleChoiceHorizontal([bool $allow = true ]) : mixed
Parameters
- $allow : bool = true
-
Whether to allow or not (default true)
Tags
setAllowSplittingSingleChoiceVertical()
Set allow splitting
public
setAllowSplittingSingleChoiceVertical([bool $allow = true ]) : mixed
Parameters
- $allow : bool = true
-
Whether to allow or not (default true)
Tags
setAllowSplittingVas()
Set allow splitting
public
setAllowSplittingVas([bool $allow = true ]) : mixed
Parameters
- $allow : bool = true
-
Whether to allow or not (default true)
Tags
setBackgroundColourQuestion()
Set background colour for a question
public
setBackgroundColourQuestion(int $colour) : mixed
Parameters
- $colour : int
-
Background colour between 0 and 255
Tags
setBackgroundColourSection()
Set background colour for a section
public
setBackgroundColourSection(int $colour) : mixed
Parameters
- $colour : int
-
Background colour between 0 and 255
Tags
setConfig()
Set _config for pdf
public
setConfig(mixed $tcpdf) : mixed
Parameters
- $tcpdf : mixed
Tags
setCornerBoxes()
Set whether to use corner boxes
public
setCornerBoxes() : none
Tags
Return values
nonesetCornerLines()
Set whether to use corner lines
public
setCornerLines() : none
Tags
Return values
nonesetEdgeDetectionFormat()
Wrapper function for setCornerBoxes and setCornerLines methods
public
setEdgeDetectionFormat(type $format) : none
Parameters
- $format : type
-
lines or boxes
Tags
Return values
nonesetLanguage()
public
setLanguage(mixed $language) : mixed
Parameters
- $language : mixed
setPageFormat()
Set page format
public
setPageFormat(string $format[, mixed $orientation = '' ]) : mixed
Parameters
- $format : string
-
page format
- $orientation : mixed = ''
Tags
setPageOrientation()
Set page orientation
public
setPageOrientation(string $orientation[, mixed $autopagebreak = '' ][, mixed $bottommargin = '' ]) : mixed
Parameters
- $orientation : string
-
page orientation
- $autopagebreak : mixed = ''
- $bottommargin : mixed = ''
Tags
setQuestionnaireInfoMargin()
Set margin before questionnare info
public
setQuestionnaireInfoMargin(int $margin) : mixed
Parameters
- $margin : int
-
between 0 and 100mm
Tags
setResponseLabelFontSize()
Set the response label normal font size
public
setResponseLabelFontSize(mixed $normalsize) : mixed
Parameters
- $normalsize : mixed
Tags
setResponseLabelFontSizeSmall()
Set the response label small font size
public
setResponseLabelFontSizeSmall(mixed $smallsize) : mixed
Parameters
- $smallsize : mixed
Tags
setResponseTextFontSize()
Set the response text font size
public
setResponseTextFontSize(int $size) : mixed
Parameters
- $size : int
Tags
setSectionHeight()
Set the minimum section height
public
setSectionHeight(int $height) : mixed
Parameters
- $height : int
-
The minimum height of a section
Tags
setSingleResponseAreaHeight()
Set vertical height of a single response item
public
setSingleResponseAreaHeight(int $height) : mixed
Parameters
- $height : int
-
Height between 1 and 100mm
Tags
setSingleResponseHorizontalHeight()
Set the height of responses items in a sub question matrix
public
setSingleResponseHorizontalHeight(int $height) : mixed
Parameters
- $height : int
-
Height between 1 and 100mm
Tags
setStyle()
Set the CSS styling of some questionnaire elements
public
setStyle(string $style) : none
Parameters
- $style : string
-
The CSS styling of some questionnire elements
Tags
Return values
nonetablehead()
Creates a Table with equal cell width and Bold text. Used as Head for equalTable()
public
tablehead(mixed $array) : void
Parameters
- $array : mixed
tableintopdf()
Creates a table using the full width of page
public
tableintopdf( $array[, $modulo = 1 ]) : void
Parameters
titleintopdf()
Writes a big title in the page + description
public
titleintopdf( $title[, $description = '' ]) : void
Parameters
write_out()
public
write_out(mixed $name) : mixed
Parameters
- $name : mixed
addBox()
Add a box to the page layout system
protected
addBox(int $tlx, int $tly, int $brx, int $bry[, string $value = "" ][, string $label = "" ]) : mixed
Parameters
- $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 "".
addBoxGroup()
Add a box group to the page layout system
protected
addBoxGroup(int $type, string $varname[, string $label = "" ][, int $width = 1 ]) : mixed
VALUES(0, 'Temporary'); VALUES(1, 'Single choice'); VALUES(2, 'Multiple choice'); VALUES(3, 'Text'); VALUES(4, 'Number'); VALUES(5, 'Barcode'); VALUES(6, 'Long text');
Parameters
- $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 = 1
-
The width of this group Optional, defaults to 1.
Tags
addBoxGroupCopyPrevious()
Add a new box group which is a copy of the previous one (if exists)
protected
addBoxGroupCopyPrevious() : mixed
Tags
addSection()
Add a new section to the page
protected
addSection([string $desc = 'queXMLPDF Section' ][, mixed $title = false ][, string $info = false ]) : mixed
Parameters
- $desc : string = 'queXMLPDF Section'
-
The description of this section
- $title : mixed = false
- $info : string = false
-
Information for this section
createQuestion()
Create a question that may have multiple response groups
protected
createQuestion(array<string|int, mixed> $question) : mixed
questions (title, text, specifier, helptext, helptextafter) responses (varname) subquestions subquestion(text, varname) response (type, width, text, rotate) categories category(text, value, skipto, other)
Parameters
- $question : array<string|int, mixed>
-
The questions portion of the array
Tags
drawCells()
Draw X number of cells at the current X Y position
protected
drawCells(int $cells, string $string) : mixed
Parameters
- $cells : int
-
The number of text cells to draw
- $string : string
-
A string to draw if set
Tags
drawHorizontalResponseBox()
Draw a horizontal response box with possible eye guides and arrows
protected
drawHorizontalResponseBox(int $x, int $y[, string $position = 'only' ][, bool $downarrow = false ][, bool $rightarrow = false ][, bool $smallwidth = false ][, bool $filled = false ]) : mixed
Parameters
- $x : int
-
The x position of the box area (top left)
- $y : int
-
The y position of the box area (top left)
- $position : string = 'only'
-
What position the box is in for the eye guides
- $downarrow : bool = false
-
Draw a down arrow?
- $rightarrow : bool = false
-
Draw an arrow to the right?
- $smallwidth : bool = false
-
Whether or not to use the small width
- $filled : bool = false
-
Whether or not to have the box pre-filled
drawInfo()
Draw the questionnaire info specified
protected
drawInfo(mixed $info) : mixed
Parameters
- $info : mixed
Tags
drawLongText()
Draw a large empty box for writing in text
protected
drawLongText(mixed $width[, bool|string $defaultvalue = false ][, bool|string $text = false ]) : mixed
Parameters
- $width : mixed
-
The "width" of the box. This relates to the number of "lines" high
- $defaultvalue : bool|string = false
-
The default text to print in the box (if any)
- $text : bool|string = false
-
The text to display above the box (if any)
Tags
drawMatrixBarcode()
Draw a barcode as a "question"
protected
drawMatrixBarcode(string $subquestions, string $type) : mixed
Parameters
- $subquestions : string
- $type : string
Tags
drawMatrixTextHorizontal()
Draw a horizontal table of text boxes
protected
drawMatrixTextHorizontal(array<string|int, mixed> $subquestions, int $width[, string|bool $parenttext = false ][, int $bgtype = 3 ][, string|bool $responsegrouplabel = false ]) : mixed
Parameters
- $subquestions : array<string|int, mixed>
-
The subquestions
- $width : int
-
The width
- $parenttext : string|bool = false
-
The question text of the parent or false if not specified
- $bgtype : int = 3
-
The type of the box group (defaults to 3 - text)
- $responsegrouplabel : string|bool = false
-
The label for this response group or false if not specified
Tags
drawMatrixTextVertical()
Draw text responses line by line
protected
drawMatrixTextVertical(array<string|int, mixed> $subquestions, int $width[, string|bool $parenttext = false ][, int $bgtype = 3 ][, string|bool $responsegrouplabel = false ][, string|bool $split = 'notset' ]) : mixed
Parameters
- $subquestions : array<string|int, mixed>
-
The subquestions containing text and varname
- $width : int
-
The width of the text element
- $parenttext : string|bool = false
-
The question text of the parent or false if not specified
- $bgtype : int = 3
-
The box group type (default is 3 - text)
- $responsegrouplabel : string|bool = false
-
The label for this response group or false if not specified
- $split : string|bool = 'notset'
-
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
Tags
drawMatrixVas()
Draw multiple VAS items
protected
drawMatrixVas(array<string|int, mixed> $subquestions, string|bool $parenttext, string $labelleft, string $labelright[, string|bool $split = 'notset' ]) : mixed
Parameters
- $subquestions : array<string|int, mixed>
-
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 = 'notset'
-
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
Tags
drawOther()
Draw an "other" box
protected
drawOther(array<string|int, mixed> $other) : TODO
Parameters
- $other : array<string|int, mixed>
-
An array containing varname,text,width,defaultvalue
Tags
Return values
TODOdrawQuestionHead()
Draw the header of a question (question title, text and help text if any)
protected
drawQuestionHead(string $title, string $text[, string|bool $help = false ][, string|bool $specifier = false ]) : mixed
Parameters
- $title : string
-
The question title (number)
- $text : string
-
The question text (can be HTML)
- $help : string|bool = false
-
The question help text or false if none (can be HTML)
- $specifier : string|bool = false
-
The question specifier text or false if none (can be HTML)
drawSingleChoiceHorizontal()
Draw a horizontal table of respones including "eye guides"
protected
drawSingleChoiceHorizontal(array<string|int, mixed> $categories[, array<string|int, mixed> $subquestions = array(array('text' => '')) ][, string|bool $parenttext = false ][, string|bool $responsegrouplabel = false ][, string|bool $split = "notset" ]) : mixed
Parameters
- $categories : array<string|int, mixed>
-
The response categories
- $subquestions : array<string|int, mixed> = array(array('text' => ''))
-
The subquestions if any
- $parenttext : string|bool = false
-
The question text of the parent or false if not specified
- $responsegrouplabel : string|bool = false
-
The label for this response group or false if not specified
- $split : string|bool = "notset"
-
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
Tags
drawSingleChoiceHorizontalHead()
Draw the head of a single choice horizontal table of responses
protected
drawSingleChoiceHorizontalHead(array<string|int, mixed> $categories[, string|bool $responsegrouplabel = false ]) : mixed
Parameters
- $categories : array<string|int, mixed>
-
The response categories
- $responsegrouplabel : string|bool = false
-
The label for this response group or false if not specified
Tags
drawSingleChoiceVertical()
Draw a vertical table of single choice responses including "eye guides"
protected
drawSingleChoiceVertical(array<string|int, mixed> $categories[, array<string|int, mixed> $subquestions = array(array('text' => '')) ][, string|bool $parenttext = false ][, string|bool $split = 'notset' ]) : mixed
Parameters
- $categories : array<string|int, mixed>
-
An array containing the category text, value, skipto and other
- $subquestions : array<string|int, mixed> = array(array('text' => ''))
-
An array containing the subquestions if any
- $parenttext : string|bool = false
-
The question text of the parent or false if not specified
- $split : string|bool = 'notset'
-
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
Tags
drawSingleChoiceVerticalHead()
Draw the head of a single choice vertical table of responses
protected
drawSingleChoiceVerticalHead(array<string|int, mixed> $subquestions) : mixed
Parameters
- $subquestions : array<string|int, mixed>
-
The subquestions
Tags
drawSingleChoiceVerticalSeparate()
Draw vertical questions separately instead of in a matrix
protected
drawSingleChoiceVerticalSeparate(array<string|int, mixed> $categories, array<string|int, mixed> $subquestions, string|bool $parenttext, string|bool $help[, string|bool $split = 'notset' ]) : mixed
Parameters
- $categories : array<string|int, mixed>
-
An array containing the category text, value, skipto and other
- $subquestions : array<string|int, mixed>
-
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 = 'notset'
-
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
Tags
drawText()
Draw a text response
protected
drawText(string $text, int $width[, bool|string $defaultvalue = false ]) : mixed
Parameters
- $text : string
-
The text label if any (can be HTML)
- $width : int
-
The number of boxes to draw
- $defaultvalue : bool|string = false
-
The default text to include or false if none
drawVas()
Draw a VAS
protected
drawVas(string $text, string $labelleft, string $labelright[, bool $heading = true ]) : mixed
Parameters
- $text : string
-
The text of this item
- $labelleft : string
-
The left hand side label
- $labelright : string
-
The right hand side label
- $heading : bool = true
-
Whether to draw a heading or not
Tags
drawVerticalResponseBox()
Draw a vertical response box with possible eye guides and arrows
protected
drawVerticalResponseBox(int $x, int $y[, string $position = 'only' ][, bool $downarrow = false ][, bool $rightarrow = false ][, bool $filled = false ]) : mixed
Parameters
- $x : int
-
The x position of the box area (top left)
- $y : int
-
The y position of the box area (top left)
- $position : string = 'only'
-
What position the box is in for the eye guides
- $downarrow : bool = false
-
Draw a down arrow?
- $rightarrow : bool = false
-
Draw an arrow to the right?
- $filled : bool = false
-
Whether or not to have the box pre-filled
fillLastPageBackground()
Make sure to fill the remaining columns on the last page
protected
fillLastPageBackground() : mixed
Tags
fillPageBackground()
Draw the background from the current Y position to the bottom of the page
protected
fillPageBackground() : mixed
Tags
getColumnWidth()
The width of the writable column
protected
getColumnWidth() : float
Tags
Return values
float —The width of the current column
getColumnX()
The X coordinate of the start of the column
protected
getColumnX() : float
Tags
Return values
float —The X coordinate of the start of the current column
getMainPageWidth()
The width of the writeable page
protected
getMainPageWidth() : float
Tags
Return values
float —The width of the writeable page
getMainPageX()
protected
getMainPageX() : mixed
init()
Initialise TCPDF width some default values and embedded fonts
protected
init() : TODO
Tags
Return values
TODOnewPage()
Create a new queXML PDF page
protected
newPage([mixed $init = false ]) : mixed
Draw the barcode and page corners
Parameters
- $init : mixed = false
setBackground()
Set the background wash of the page
protected
setBackground([string $type = 'empty' ]) : mixed
Parameters
- $type : string = 'empty'
-
Optional, defaults to 'empty'.
Tags
setDefaultFont()
Set font size and style
protected
setDefaultFont([int $size = 12 ][, string $style = '' ]) : TODO
Parameters
- $size : int = 12
-
Optional, defaults to 12
- $style : string = ''
-
Optional, defaults to ''.
Tags
Return values
TODOwordLength()
Return the length of the longest word
protected
wordLength(mixed $txt) : int
Parameters
- $txt : mixed
Tags
Return values
int —Length of longest word