\Hazaar\Controller\Response
PDF
Summary
Methods Properties Constants
Constants
PDF_ASSTRING
PDF_ASSTRING
PDF_DOWNLOAD
PDF_DOWNLOAD
PDF_EMBEDDED
PDF_EMBEDDED
PDF_LANDSCAPE
PDF_LANDSCAPE
PDF generated as landscape (horizontal).
PDF_PORTRAIT
PDF_PORTRAIT
PDF generated as landscape (vertical).
Properties
$cmd
$cmd
$copies
$copies
$grayscale
$grayscale
$html
$html
$last_error
$last_error
$mode
$mode
$orient
$orient
$size
$size
$source_url
$source_url
$status
$status
$title
$title
$tmp
$tmp
$toc
$toc
Methods
__construct()
__construct($mode = 'self')
Constructor: initialize command line and reserve temporary file.

Parameters

$mode

No description

Static
_pipeExec()
_pipeExec($cmd, $input = '') : array
Advanced execution routine.

Parameters

$cmdstring

The command to execute.

$inputstring

Any input not in arguments.

Returns

array

An array of execution data; stdout, stderr and return “error” code.

Static
getCommand()
getCommand()
getStatus()
getStatus() : string
Returns WKPDF print status.

Returns

string

WPDF print status.

install()
install()
render()
render()
Convert HTML to PDF.
setCopies()
setCopies($count)
Set the number of copies to be printed.

By default it is one.

Parameters

$countinteger

Number of page copies.

setGrayscale()
setGrayscale($mode)
Whether to print in grayscale or not.

By default it is OFF.

Parameters

$mode

No description

setHtml()
setHtml($html)
Set html content.

Parameters

$htmlstring

New html content. It replaces any previous content.

setMode()
setMode($mode)

Parameters

$mode

No description

setOrientation()
setOrientation($mode)
Set orientation, use constants from this class.

By default orientation is portrait.

Parameters

$modestring

Use constants from this class.

setPageSize()
setPageSize($size)
Set page/paper size.

By default page size is A4.

Parameters

$sizestring

Formal paper size (eg; A4, letter…)

setSource()
setSource($url)
Set source URL of content.

Parameters

$urlstring

A url accessible from the host that will be rendered to a PDF

setTOC()
setTOC($enabled)
Whether to automatically generate a TOC (table of contents) or not.

By default TOC is disabled.

Parameters

$enabledboolean

True use TOC, false disable TOC.

setTitle()
setTitle($text)
Set PDF title. If empty, HTML of first document is used.</div><div class="doc-page-detail"><p>By default it is empty.</p></div><div class="doc-page-content"><h4>Parameters</h4><table class="table"><tr><td class="func-name">$text</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr></table></div><div class="api-tags"></div> <a name="func_write"></a> <div class="doc-member-hdr"> <i class="fa fa-check-square-o"></i>write()</div> <div class="doc-page-code"><button type="button" class="btn-code btn" data-source="hazaar-mvc/src/Controller/Response/PDF.php" data-line="314"><i class="fa fa-code"></i></button></div> <div class="doc-member-def">write()</div><div class="doc-page-content"></div><div class="api-tags"><span class="label label-primary">Inherited</span></div> <a name="func_setController"></a> <div class="doc-member-hdr"> <i class="fa fa-check-square-o"></i>setController()</div> <div class="doc-page-code"><button type="button" class="btn-code btn" data-source="hazaar-mvc/src/Controller/Response/HTTP/OK.php" data-line="32"><i class="fa fa-code"></i></button></div> <div class="doc-member-def">setController($controller)</div><div class="doc-page-content"><h4>Parameters</h4><table class="table"><tr><td class="func-name">$controller</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr></table></div><div class="api-tags"><span class="label label-primary">Inherited</span></div> <a name="func_setHeader"></a> <div class="doc-member-hdr"> <i class="fa fa-check-square-o"></i>setHeader()</div> <div class="doc-page-code"><button type="button" class="btn-code btn" data-source="hazaar-mvc/src/Controller/Response/HTTP/OK.php" data-line="41"><i class="fa fa-code"></i></button></div> <div class="doc-member-def">setHeader($key, $value, $overwrite = true)</div><div class="doc-page-brief">Add Header Directive</div><div class="doc-page-detail"></div><div class="doc-page-content"><h4>Parameters</h4><table class="table"><tr><td class="func-name">$key</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr><tr><td class="func-name">$value</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr><tr><td class="func-name">$overwrite</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr></table></div><div class="api-tags"><span class="label label-primary">Inherited</span></div> <a name="func_setHeaders"></a> <div class="doc-member-hdr"> <i class="fa fa-check-square-o"></i>setHeaders()</div> <div class="doc-page-code"><button type="button" class="btn-code btn" data-source="hazaar-mvc/src/Controller/Response/HTTP/OK.php" data-line="186"><i class="fa fa-code"></i></button></div> <div class="doc-member-def">setHeaders($content_length = null)</div><div class="doc-page-content"><h4>Parameters</h4><table class="table"><tr><td class="func-name">$content_length</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr></table></div><div class="api-tags"><span class="label label-primary">Inherited</span></div> <a name="func_setStatus"></a> <div class="doc-member-hdr"> <i class="fa fa-check-square-o"></i>setStatus()</div> <div class="doc-page-code"><button type="button" class="btn-code btn" data-source="hazaar-mvc/src/Controller/Response/HTTP/OK.php" data-line="160"><i class="fa fa-code"></i></button></div> <div class="doc-member-def">setStatus($status)</div><div class="doc-page-content"><h4>Parameters</h4><table class="table"><tr><td class="func-name">$status</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr></table></div><div class="api-tags"><span class="label label-primary">Inherited</span></div> <a name="func_setStatusCode"></a> <div class="doc-member-hdr"> <i class="fa fa-check-square-o"></i>setStatusCode()</div> <div class="doc-page-code"><button type="button" class="btn-code btn" data-source="hazaar-mvc/src/Controller/Response/HTTP/OK.php" data-line="88"><i class="fa fa-code"></i></button></div> <div class="doc-member-def">setStatusCode($code)</div><div class="doc-page-content"><h4>Parameters</h4><table class="table"><tr><td class="func-name">$code</td><td class="func-type"></td><td class="func-desc"><p><i class="small">No description</i></p></td></tr></table></div></div> </div> <div id="commentTemplate" style="display: none; margin-top: 50px;"> <h3>Comments</h3> <div style="text-align: center;"> <div class="btn" id="addComment"><span class="icon-edit"></span> Add comment</div> </div> <div id="newComment"> <form> <input type="hidden" name="username" value="" class="username"/> <input type="hidden" name="page" value=""/> <div> <div class="newComment-input"> <textarea id="comment" name="comment"></textarea> </div> <div class="newComment-info"> <div class="pull-right"> <button type="button" id="save" class="primary" onclick="addComment('http://www.hazaarmvc.com/', this.form);">Add Comment</button> </div> <div class="has_user">Commenting as <span class="fullname"> </span> </div> <div class="no_user"><input type="text" name="name" value="" placeholder="Your Name"/> <input type="text" name="email" value="" placeholder="Email Address"/></div> </div> </div> </form> </div> <div class="comment-block"></div> </div> </div> </div> </div> <div class="page-footer"> <footer class="footer-main"> <div class="footer-top"> </div> <div class="footer-middle"> <div class="row"><div class="module"><ul class="menu"><li><a href="http://www.hazaarmvc.com/the-team" title="The Team"><span>The Team</span></a></li><li><a href="http://git.hazaarlabs.com/hazaar/hazaar-mvc" title="Contribute" target="_top"><span>Contribute</span></a></li><li><a href="http://www.hazaarmvc.com/docs/getting-started/download-install" title="Download"><span>Download</span></a></li><li><a href="https://github.com/JAZ-013/hazaar-mvc" title="Hazaar MVC on Github" target="_top"><span>Hazaar MVC on Github</span></a></li><li><a href="http://www.hazaarcms.com" title="Hazaar CMS" target="_top"><span>Hazaar CMS</span></a></li></ul></div></div> </div> <div class="footer-bottom"> <div class="row"> <div class="link-top" onclick="$('html, body').stop().animate({scrollTop:0}, 1000, 'swing');"> <i class="fa fa-chevron-up"></i> </div> <div class="poweredby"> <p>Powered by <a href="http://www.hazaarcms.com" target="_blank">Hazaar CMS</a></p> </div> </div> </div> </footer> </div> <script type="text/javascript" src="http://www.hazaarmvc.com/hazaar/js/hazaar.js"></script> <script type="text/javascript">var hazaar = new HazaarJSHelper("http://www.hazaarmvc.com/", []);</script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript" src="http://www.hazaarmvc.com/hazaar/js/jquery-helper.js"></script> <script type="text/javascript">var sitePATH = '/'; var siteURL = 'http://www.hazaarmvc.com/'; var apiURL = siteURL + 'api'; var siteData = []; </script> <script type="text/javascript" src="http://www.hazaarmvc.com/script/siteinit.js"></script> <script type="text/javascript" src="http://www.hazaarmvc.com/theme/script/site.js"></script> <script type="text/javascript" src="http://www.hazaarmvc.com/theme/script/highlight.pack.js"></script> <script type="text/javascript" src="http://www.hazaarmvc.com/output/apidoc/module.js"></script> </body> </html>