Gems standaard Pdf utility functions
package | Gems |
---|---|
subpackage | |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.0 |
inherited_from | \Gems_Registry_TargetAbstract |
__get(string $name) : Callable
string
Callable
afterRegistry() : void
convertFromHtml(string $content) : string
string
The HTML source
\Exception |
---|
string
The converted PDF fileechoPdfBySurveyId($surveyId)
.
echoPdfByTokenId(string $tokenId)
string
echoPdfContent(string $content, string $filename, boolean $download = false
)
string
The content to echo
string
The filename as reported to the downloader
boolean
Download to file or when false: show in browser
getSurveysDir() : string
Used by the Survey Controller when uploading surveys.
string
getUploadDir(string $subdir = null
) : string
You can overrule this function to specify your own directory.
string
Optional sub-directory, when starting with / or x:\ only $subdir is used. Function creates subdirectory if it does not exist.
string
hasPdfExport() : boolean
boolean
addTokenToDocument(\Zend_Pdf $pdf, string $tokenId, integer $surveyId)
\Zend_Pdf
string
integer
addTokenToPage(\Zend_Pdf_Page $page, string $tokenId)
\Zend_Pdf_Page
string
echoPdf(\Zend_Pdf $pdf, string $filename, boolean $download= false
, boolean $exit= true
)
When download is true the file is returned as a download link, otherwise the pdf is shown in the browser.
\Zend_Pdf
string
boolean
boolean
Should the application stop running after output
getSurveyPdf(integer $surveyId) : \Zend_Pdf
integer
\Zend_Pdf
throwLastError($msg) : string
string
/
public function rename($source, $destination)
{
if (file_exists($source)) {
$dir = dirname($destination);
if (! is_dir($dir)) {
$oldmask = umask(0777);
if (! @mkdir($dir, 0777, true)) {
$this->throwLastError("Could not create '$dir' directory.");
}
umask($oldmask);
}
if (file_exists($destination)) {
if (! unlink($destination)) {
$this->throwLastError("Could not remove existing '$destination' file.");
}
}
if (! rename($source, $destination)) {
$this->throwLastError("Could not rename '$source' to '$destination'.");
}
} else {
$this->throwLastError("Source file '$source' does not exist.");
}
}$_pdfExportCommand : string
""
$db : \Zend_Db_Adapter_Abstract
$pageFont : string
\Zend_Pdf_Font::FONT_COURIER
$pageFontSize : integer
12
$pageX : integer
10
$pageXfromLeft : boolean
true
$pageY : integer
20
$pageYfromTop : boolean
true
$project : \Gems_Project_ProjectSettings
$translate : \Zend_Translate