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 | |
link | |
link | |
package | Default |
__construct()
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
addAnswer(string $sQuestion,string $sResponse,boolean $bReplaceExpressions = true,boolean $bAllowBreakPage = false): void
string
string
boolean
boolean
addBox(integer $tlx,integer $tly,integer $brx,integer $bry,string $value = "",string $label = "")
integer
Top left X
integer
Top left Y
integer
Bottom right X
integer
Bottom right Y
string
Optional, defaults to "".
string
Optional, defaults to "".
addBoxGroup(integer $type,string $varname,string $label = "",integer $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 |
integer
The type of box group for verification purposes
string
The variable name
string
The label for the box group Optional, defaults to "".
integer
The width of this group Optional, defaults to 1.
addBoxGroupCopyPrevious()
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-03-26 |
addGidAnswer( $sGroupName,string $sGroupDescription, $bAllowBreakPage = false): void
string
addHeader(array $aPdfLanguageSettings,string $sSiteName,string $sDefaultHeaderString): void
array
string
string
addSection(string $desc = 'queXMLPDF Section', $title = false,string $info = false)
string
The description of this section
string
Information for this section
addTitle(string $sTitle,string $sSubtitle = ""): void
string
string
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)
array
The questionnaire in the array format above
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 |
---|---|
array
The questions portion of the array
createqueXML(string $quexml): array
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-08 |
see | \create |
string
The queXML file
array
An array readable by create
delete_html( $text)
drawCells(integer $cells,string $string)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-08 |
integer
The number of text cells to draw
string
A string to draw if set
drawHorizontalResponseBox(integer $x,integer $y,string $position = 'only',boolean $downarrow = false,boolean $rightarrow = false,boolean $smallwidth = false,boolean $filled = false)
integer
The x position of the box area (top left)
integer
The y position of the box area (top left)
string
What position the box is in for the eye guides
boolean
Draw a down arrow?
boolean
Draw an arrow to the right?
boolean
Whether or not to use the small width
boolean
Whether or not to have the box pre-filled
drawInfo( $info)
drawLongText(mixed $width,boolean|string $defaultvalue = false,boolean|string $text = false)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-02 |
mixed
The "width" of the box. This relates to the number of "lines" high
boolean|string
The default text to print in the box (if any)
boolean|string
The text to display above the box (if any)
drawMatrixBarcode(string $subquestions,string $type)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-06-22 |
string
string
drawMatrixTextHorizontal(array $subquestions,integer $width,string|boolean $parenttext = false,integer $bgtype = 3,string|boolean $responsegrouplabel = false)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-08 |
array
The subquestions
integer
The width
string|boolean
The question text of the parent or false if not specified
integer
The type of the box group (defaults to 3 - text)
string|boolean
The label for this response group or false if not specified
drawMatrixTextVertical(array $subquestions,integer $width,string|boolean $parenttext = false,integer $bgtype = 3,string|boolean $responsegrouplabel = false,string|boolean $split = 'notset')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-02 |
array
The subquestions containing text and varname
integer
The width of the text element
string|boolean
The question text of the parent or false if not specified
integer
The box group type (default is 3 - text)
string|boolean
The label for this response group or false if not specified
string|boolean
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
drawMatrixVas(array $subquestions,string|boolean $parenttext,string $labelleft,string $labelright,string|boolean $split = 'notset')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-20 |
array
The subquestions containing text and varname
string|boolean
The question text of the parent or false if not specified
string
The left hand side label
string
The right hand side label
string|boolean
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
drawOther(array $other): \TODO
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-05-01 |
array
An array continaing varname,text,width,defaultvalue
\TODO
drawQuestionHead(string $title,string $text,string|boolean $help = false,string|boolean $specifier = false)
string
The question title (number)
string
The question text (can be HTML)
string|boolean
The question help text or false if none (can be HTML)
string|boolean
The question specifier text or false if none (can be HTML)
drawSingleChoiceHorizontal(array $categories,array $subquestions = array(array('text' => '')),string|boolean $parenttext = false,string|boolean $responsegrouplabel = false,string|boolean $split = "notset")
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-08 |
array
The response categories
array
The subquestions if any
string|boolean
The question text of the parent or false if not specified
string|boolean
The label for this response group or false if not specified
string|boolean
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
drawSingleChoiceHorizontalHead(array $categories,string|boolean $responsegrouplabel = false)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-06-05 |
array
The response categories
string|boolean
The label for this response group or false if not specified
drawSingleChoiceVertical(array $categories,array $subquestions = array(array('text' => '')),string|boolean $parenttext = false,string|boolean $split = 'notset')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-02 |
array
An array containing the category text, value, skipto and other
array
An array containing the subquestions if any
string|boolean
The question text of the parent or false if not specified
string|boolean
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
drawSingleChoiceVerticalHead(array $subquestions)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-24 |
array
The subquestions
drawSingleChoiceVerticalSeparate(array $categories,array $subquestions,string|boolean $parenttext,string|boolean $help,string|boolean $split = 'notset')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-07-30 |
array
An array containing the category text, value, skipto and other
array
An array containing the subquestions if any
string|boolean
The question text of the parent or false if not specified
string|boolean
Help text if any for the responses
string|boolean
Allow splitting this over multiple pages. 'notset' means leave default. Otherwise force setting
drawText(string $text,integer $width,boolean|string $defaultvalue = false)
string
The text label if any (can be HTML)
integer
The number of boxes to draw
boolean|string
The default text to include or false if none
drawVas(string $text,string $labelleft,string $labelright,boolean $heading = true)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-20 |
string
The text of this item
string
The left hand side label
string
The right hand side label
boolean
Whether to draw a heading or not
drawVerticalResponseBox(integer $x,integer $y,string $position = 'only',boolean $downarrow = false,boolean $rightarrow = false,boolean $filled = false)
integer
The x position of the box area (top left)
integer
The y position of the box area (top left)
string
What position the box is in for the eye guides
boolean
Draw a down arrow?
boolean
Draw an arrow to the right?
boolean
Whether or not to have the box pre-filled
equalTable( $array,integer $modulo = 1): void
integer
exportStyleXML()
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2015-06-18 |
fillLastPageBackground()
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-05-31 |
fillPageBackground()
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-15 |
getAllowSplittingMatrixText(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not
getAllowSplittingResponses(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not
getAllowSplittingSingleChoiceHorizontal(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not
getAllowSplittingSingleChoiceVertical(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not
getAllowSplittingVas(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not
getBackgroundColourQuestion(): integer
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Background colour between 0 and 255
getBackgroundColourSection(): integer
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Background colour between 0 and 255
getColumnWidth(): double
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-05-30 |
double
The width of the current column
getColumnX(): double
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-05-30 |
double
The X coordinate of the start of the current column
getCornerBoxes(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2014-12-22 |
boolean
whether to use corner boxes
getCornerLines(): boolean
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2014-12-22 |
boolean
whether to use corner lines
getEdgeDetectionFormat(): string
author | A A D V S Abeysinghe venura@acspri.org.au |
---|---|
since | 2015-07-08 |
string
whether to use corner lines or boxes
getEqualWidth( $array): mixed
Good for static tables with equal value String-length
mixed
getFullWidth( $array): array
..
array
with column width
getLayout(): string
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-20 |
string
The XML layout in queXF Banding XML format
getMainPageWidth(): double
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-02 |
double
The width of the writeable page
getMainPageX()
getmaxwidth( $array)
getminwidth( $array)
getPageFormat(): string
getPageOrientation(): string
getQuestionnaireId(): integer
getQuestionnaireInfoMargin(): integer
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Height in mm between 0 and 100
getResponseLabelFontSize(): resource
getResponseLabelFontSizeSmall(): resource
getResponseTextFontSize(): resource
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-04-10 |
resource
The response text font size
getSectionHeight(): string
getSingleResponseAreaHeight(): string
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
string
Height in mm between 1 and 100
getSingleResponseHorizontalHeight(): string
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
string
Height in mm between 1 and 100
getStyle(): string
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-04-10 |
string
The style without HTML or tabs
Header()
headTable( $head, $table, $modulo = 1): void
importStyleXML( $xmlsettings)
init(): \TODO
initAnswerPDF(array $aSurveyInfo,array $aPdfLanguageSettings,string $sSiteName,string $sSurveyName,string $sDefaultHeaderString = ''): void
array
array
string
string
string
intopdf(string $text, $format = ''): void
deprecated |
---|
string
mm2px(float $mm): double
float
Measurement in millimetres
double
Pixel value as an integer
newPage( $init = false)
Draw the barcode and page corners
numberToLetter(integer $number): string
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-08 |
integer
string
Letter(s) corresponding to the number
setAllowSplittingMatrixText(boolean $allow = true)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not (default true)
setAllowSplittingResponses(boolean $allow = true)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not (default true)
setAllowSplittingSingleChoiceHorizontal(boolean $allow = true)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not (default true)
setAllowSplittingSingleChoiceVertical(boolean $allow = true)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not (default true)
setAllowSplittingVas(boolean $allow = true)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
boolean
Whether to allow or not (default true)
setBackground(string $type = 'empty')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-09-02 |
string
Optional, defaults to 'empty'.
setBackgroundColourQuestion(integer $colour)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Background colour between 0 and 255
setBackgroundColourSection(integer $colour)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Background colour between 0 and 255
setConfig(mixed $tcpdf):
access | public |
---|
mixed
setCornerBoxes(): \none
setCornerLines(): \none
setDefaultFont(integer $size = 12,string $style = ''): \TODO
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2010-11-05 |
integer
Optional, defaults to 12
string
Optional, defaults to ''.
\TODO
setEdgeDetectionFormat(\type $format): \none
author | A A D V S Abeysinghe venura@acspri.org.au |
---|---|
since | 2015-07-08 |
\type
lines or boxes
\none
setLanguage( $language)
setPageFormat(string $format, $orientation = '')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2015-06-19 |
string
page format
setPageOrientation(string $orientation, $autopagebreak = '', $bottommargin = '')
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2015-06-19 |
string
page orientation
setQuestionnaireInfoMargin(integer $margin)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
between 0 and 100mm
setResponseLabelFontSize( $normalsize)
setResponseLabelFontSizeSmall( $smallsize)
setResponseTextFontSize(integer $size)
setSectionHeight(integer $height)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-07-30 |
integer
The minimum height of a section
setSingleResponseAreaHeight(integer $height)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Height between 1 and 100mm
setSingleResponseHorizontalHeight(integer $height)
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-10-25 |
integer
Height between 1 and 100mm
setStyle(string $style): \none
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2013-04-10 |
string
The CSS styling of some questionnire elements
\none
tablehead( $array): void
tableintopdf( $array, $modulo = 1): void
Table array( 0=> array("td", "td", "td"), 1=> array("td", "td", "td"))
Fills each second row with a light-grey for better visibility. Default is off, turn on with 1
titleintopdf( $title, $description = ''): void
wordLength(mixed $txt): integer
author | Adam Zammit adam.zammit@acspri.org.au |
---|---|
since | 2012-03-30 |
mixed
integer
Length of longest word
write_out( $name)
INCH_IN_MM
const | float Defaults to 25.4 |
---|---|
language :
ppi :integer
var | Defaults to 300. |
---|
integer
pageBreakOccured :boolean
var |
---|
boolean
cornerBorder :integer
var | Defaults to 15. |
---|---|
since |
integer
cornerLength :mixed
var | Defaults to 20. |
---|---|
since |
mixed
cornerWidth :mixed
var | Defaults to 0.5. |
---|---|
since |
mixed
cornerBoxWidth :float
var | Defaults to 4.57 |
---|---|
since |
float
questionnaireId :mixed
var | Defaults to 1. |
---|---|
since |
mixed
idLength :integer
var | Defaults to 6. |
---|---|
since | |
see |
integer
pageLength :mixed
var | Defaults to 2. |
---|---|
since | |
see |
mixed
questionTitleWidth :mixed
var | Defaults to 14. |
---|---|
since |
mixed
questionTitleSuffix :mixed
var | Defaults to ".". |
---|---|
since |
mixed
questionTextRightMargin :mixed
var | Defaults to 40. |
---|---|
since | |
see |
mixed
questionBorderBottom :mixed
var | Defaults to 1. |
---|---|
since |
mixed
helpBeforeBorderBottom :mixed
var | Defaults to 3. |
---|---|
since |
mixed
helpBeforeBorderTop :mixed
var | Defaults to 3. |
---|---|
since |
mixed
skipColumnWidth :string
var | Defaults to 20. |
---|---|
since |
string
style :string
var | Defaults to "". |
---|---|
since |
string
singleResponseHorizontalHeight :string
var | Defaults to 10. Defaults to 10.5. |
---|---|
since | Height of the area of a single response where displayed horizontally |
string
singleResponseHorizontalMaxLines :string
var | Defaults to 2. |
---|---|
since | |
see |
string
singleResponseAreaHeight :string
var | Defaults to 9. |
---|---|
since |
string
singleResponseBoxWidth :string
var | Defaults to 5. |
---|---|
since |
string
singleResponseBoxHeight :string
var | Defaults to 5. |
---|---|
since |
string
singleResponseBoxBorder :string
var | Defaults to 0.1. |
---|---|
since |
string
singleResponseBoxLineLength :string
var | Defaults to 1. |
---|---|
since |
string
singleResponseVerticalAreaWidth :string
var | Defaults to 15. |
---|---|
since |
string
singleResponseVerticalAreaWidthSmall :string
var | Defaults to 9. |
---|---|
since |
string
singleResponseHorizontalMax :integer
var | Defaults to 10. |
---|---|
since |
integer
allowSplittingSingleChoiceHorizontal :boolean
var | Defaults to false. |
---|---|
since |
boolean
allowSplittingSingleChoiceVertical :boolean
var | Defaults to false. |
---|---|
since |
boolean
minSplittingSingleChoiceVertical :integer
var | Defaults to 5. |
---|---|
since |
integer
allowSplittingResponses :boolean
var | Defaults to false. |
---|---|
since |
boolean
allowSplittingMatrixText :boolean
var | Defaults to false. |
---|---|
since |
boolean
allowSplittingVas :boolean
var | Defaults to false. |
---|---|
since |
boolean
arrowHeight :array
var | Defaults to 3. |
---|---|
since |
array
textResponseWidth :mixed
var | Defaults to 6. |
---|---|
since |
mixed
textResponseBorder :mixed
var | Defaults to 0.15. Any less than this may produce printing problems |
---|---|
since |
mixed
textResponseHeight :mixed
var | Defaults to 8. |
---|---|
since |
mixed
textResponseMarginX :mixed
var | Defaults to 13. |
---|---|
since |
mixed
labelTextResponsesSameLineMarginX :mixed
var | Defaults to 62. |
---|---|
since |
mixed
textResponseLineSpacing :mixed
var | Defaults to 1. |
---|---|
since |
mixed
subQuestionLineSpacing :string
var | Defaults to 2. |
---|---|
since |
string
longTextResponseHeightMultiplier :mixed
var | Defaults to 1. |
---|---|
since |
mixed
longTextStorageWidth :integer
var | Default is 1024; |
---|---|
since |
integer
columns :integer
var | Defaults to 1. |
---|---|
since |
integer
columnBorder :integer
var | Defaults to 1. |
---|---|
since |
integer
layout :array
section :array
var | Defaults to empty array |
---|---|
since |
array
skipToRegistry :string
var | Defaults to array(). |
---|---|
since |
string
layoutCP :mixed
var | Defaults to "". |
---|---|
since |
mixed
sectionCP :string
var | Defaults to 0. |
---|---|
since |
string
boxGroupCP :boolean
var | Defaults to 0. |
---|---|
since |
boolean
boxCP :integer
var | Defaults to 0. |
---|
integer
columnCP :mixed
var | Defaults to 0. |
---|---|
since |
mixed
backgroundColourQuestion :boolean
var | Defaults to array(220,220,220). |
---|---|
since |
boolean
backgroundColourSection :boolean
var | Defaults to array(200,200,200). |
---|---|
since |
boolean
backgroundColourEmpty :boolean
var | Defaults to array(255,255,255). |
---|---|
since |
boolean
lineColour :mixed
var | Defaults to array(0,0,0). |
---|---|
since |
mixed
textColour :mixed
var | Defaults to 0. |
---|---|
since |
mixed
skipToText :string
var | Defaults to "Skip to ". |
---|---|
since |
string
vasAreaHeight :mixed
var | Defaults to 8. |
---|---|
since |
mixed
vasLineWidth :mixed
var | Defaults to 0.5. |
---|---|
since |
mixed
defaultValueLineWidth :double
var | Defaults to 0.5. |
---|---|
since |
double
vasHeight :mixed
var | Defaults to 4. |
---|---|
since |
mixed
vasLength :mixed
var | Defaults to 100. |
---|---|
since |
mixed
vasIncrements :mixed
var | Defaults to 100. |
---|---|
since |
mixed
subQuestionTextSeparator :string
var | Defaults to " : ". |
---|---|
since |
string
questionnaireInfoMargin :mixed
var | Defaults to 5. |
---|---|
since |
mixed
responseLabelHeight :resource
var | Defaults to 10. |
---|---|
since |
resource
responseLabelFontSize :resource
var | Defaults to 8. |
---|---|
since |
resource
responseLabelFontSizeSmall :resource
var | Defaults to 6. |
---|---|
since |
resource
responseLabelSmallWordLength :resource
var | Defaults to 7. |
---|---|
since |
resource
responseTextFontSize :resource
var | Defaults to 10. |
---|---|
since |
resource
skipToTextFontSize :string
var | Defaults to 8. |
---|---|
since |
string
defaultFont :string
var | Defaults to 'freeserif'. |
---|---|
since |
string
sectionHeight :string
var | Defaults to 18. |
---|---|
since |
string
cornerLines :boolean
var | Defaults to true |
---|---|
since |
boolean
cfg_constant_map :array
var | |
---|---|
access | private |
array
_config :array
var | |
---|---|
access | private |
array
_ibaseAnswerFontSize :integer
var | |
---|---|
access | private |
integer
_iCellHeight :integer
var | |
---|---|
access | private |
integer
_aSurveyInfo :array
var | |
---|---|
access | private |
array