| category | OSS | 
|---|---|
| package | OSS_Utils | 
| copyright | Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland | 
| license | New BSD License | 
HtmlToPdf(string $html, string $pdf, bool $embedFonts) : bool
Please note that the current stable version of htmldoc (v1.8.27) does not support CSS. Make sure PHP has write permission in the output directory. Also don't forget that relative paths are relative to the currently executing PHP script (include() and require() doesn't count in that). Using command line OpenOffice might be a better solution (a necessary macro and a tiny, one line shell script are available on the internet), as it supports everything in the HTML, CSS, images, etc, while the htmldoc 1.9.x is still in "developer snapshot" state.
stringthe input HTML file name
stringthe output PDF file name
booldefault false embed the used fonts to the genereated PDF or not - can save 100's of kBytes even in a plain PDF (think of email sending)
boolgenUrl(string | bool $controller, string | bool $action, string | bool $module, array $params, string $host) : string
This is a useful function as no knowledge of the application's path is required.
It is also configurable (via Zend_Application config and assuming 'options' is available in Zend_Registry as it would be from OSS_Controller_Action).
You can configure the hostname by setting config: utils.genurl.host_mode
stringbooldefault false The controller to call.
stringbooldefault false The action to call (controller must be set if setting action)
stringbooldefault false The module to use. Set to false to ignore.
arraydefault array() An array of key value pairs to add to the URL.
stringDefaults to null. Hostname (including http[s]://) to override url with
stringgetIniOption(string $option) : mixed
Don't need to use this in the controllers, the $this->_options array is available there, this is useful in models, forms and other places.
| todo | : this method is rarely called, but a way to speed it up is to store the key and value in session, and then look for it when called | 
|---|
string
mixedgetResource(string $resource) : object
Use if Zend_Registry::get() doesn't work. (And in the OSS framework it doesn't.)
string
objectgetTempDir() : string
| todo | : this method is rarely called, but a way to speed it up is to store the path in session, and then look for it when called | 
|---|
stringordinal(int $number) : string
int
stringparseXML(string $XML) : array | bool
string
arraybool
uniformDistHash(int $id, int $length) : string
First it turn given id to hex. Then it appends new hex with leading zeros to reach given length ( 3 by default ) if necessary. And then new string is reversed. From reversed string function takes as many characters as defined in length.
e.g. uniformDistHash( 216 ) returns 8/d/0/216/
     uniformDistHash( 7 ) returns 7/0/0/7/
     uniformDistHash( 5057 ) returns 1/c/3/5057/
intId for making file structure
intHow many levels should be created
stringwkhtmltopdf(string $html, string $pdf) : bool
stringthe input HTML file name
stringthe output PDF file name
bool