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
CallableafterRegistry() : void
convertFromHtml(string $content) : string
stringThe HTML source
\Exception |
|---|
stringThe converted PDF fileechoPdfBySurveyId($surveyId)
.
echoPdfByTokenId(string $tokenId)
string
echoPdfContent(string $content, string $filename, boolean $download = false)
stringThe content to echo
stringThe filename as reported to the downloader
booleanDownload to file or when false: show in browser
getSurveysDir() : string
Used by the Survey Controller when uploading surveys.
stringgetUploadDir(string $subdir = null) : string
You can overrule this function to specify your own directory.
stringOptional sub-directory, when starting with / or x:\ only $subdir is used. Function creates subdirectory if it does not exist.
stringhasPdfExport() : boolean
booleanaddTokenToDocument(\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
booleanShould the application stop running after output
getSurveyPdf(integer $surveyId) : \Zend_Pdf
integer
\Zend_PdfthrowLastError($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