<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class DOMPDF</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class DOMPDF</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">DOMPDF - PHP5 HTML to PDF renderer</p>
<div class="description"><p>DOMPDF loads HTML and does its best to render it as a PDF. It gets its name from the new DomDocument PHP5 extension. Source HTML is first parsed by a DomDocument object. DOMPDF takes the resulting DOM tree and attaches a <a href="../dompdf/Frame.html">Frame</a> object to each one. <a href="../dompdf/Frame.html">Frame</a> objects store positioning and layout information and each has a reference to a <a href="../dompdf/Style.html">Style</a> object.</p><p>Style information is loaded and parsed (see <a href="../dompdf/Stylesheet.html">Stylesheet</a>) and is applied to the frames in the tree by using XPath. CSS selectors are converted into XPath queries, and the computed <a href="../dompdf/Style.html">Style</a> objects are applied to the <a href="../dompdf/Frame.html">Frame</a>s.</p><p><a href="../dompdf/Frame.html">Frame</a>s are then decorated (in the design pattern sense of the word) based on their CSS display property (<a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">http://www.w3.org/TR/CSS21/visuren.html#propdef-display</a>). additional properties and methods specific to the particular type of <a href="../dompdf/Frame.html">Frame</a>. For example, in the CSS layout model, block frames ( display: block; ) contain line boxes that are usually filled with text or other inline frames. The Block_Frame_Decorator therefore adds a $lines property as well as methods to add <a href="../dompdf/Frame.html">Frame</a>s to lines and to add additional lines. <a href="../dompdf/Frame.html">Frame</a>s also are attached to specific Positioner and Reflower objects that contain the positioining and layout algorithm for a specific type of frame, respectively. This is an application of the Strategy pattern.</p><p>Layout, or reflow, proceeds recursively (post-order) starting at the root of the document. Space constraints (containing block width & height) are pushed down, and resolved positions and sizes bubble up. Thus, every <a href="../dompdf/Frame.html">Frame</a> in the document tree is traversed once (except for tables which use a two-pass layout algorithm). If you are interested in the details, see the reflow() method of a Reflower class.</p><p>Rendering is relatively straightforward once layout is complete. <a href="../dompdf/Frame.html">Frame</a>s are rendered using an adapted Cpdf class, originally written by Wayne Munro, http://www.ros.co.nz/pdf/. (Some performance related changes have been made to the original Cpdf class, and the <a href="../dompdf/CPDF_Adapter.html">CPDF_Adapter</a> class provides a simple, stateless interface to PDF generation.)</p></div>
<p class="notes">
Located in <a class="field" href="_include_dompdf_cls_php.html">/include/dompdf.cls.php</a> (line <span class="field">88</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">string</span>
<a href="#$_base_host" title="details" class="var-name">$_base_host</a>
</div>
<div class="var-title">
<span class="var-type">string</span>
<a href="#$_base_path" title="details" class="var-name">$_base_path</a>
</div>
<div class="var-title">
<span class="var-type"><a href="../dompdf/Stylesheet.html">Stylesheet</a></span>
<a href="#$_css" title="details" class="var-name">$_css</a>
</div>
<div class="var-title">
<span class="var-type">string</span>
<a href="#$_paper_orientation" title="details" class="var-name">$_paper_orientation</a>
</div>
<div class="var-title">
<span class="var-type">string</span>
<a href="#$_paper_size" title="details" class="var-name">$_paper_size</a>
</div>
<div class="var-title">
<span class="var-type"><a href="../dompdf/Canvas.html">Canvas</a></span>
<a href="#$_pdf" title="details" class="var-name">$_pdf</a>
</div>
<div class="var-title">
<span class="var-type">string</span>
<a href="#$_protocol" title="details" class="var-name">$_protocol</a>
</div>
<div class="var-title">
<span class="var-type"><a href="../dompdf/Frame_Tree.html">Frame_Tree</a></span>
<a href="#$_tree" title="details" class="var-name">$_tree</a>
</div>
<div class="var-title">
<span class="var-type">DomDocument</span>
<a href="#$_xml" title="details" class="var-name">$_xml</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">DOMPDF</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
()
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#get_base_path" title="details" class="method-name">get_base_path</a>
()
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#get_host" title="details" class="method-name">get_host</a>
()
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#get_protocol" title="details" class="method-name">get_protocol</a>
()
</div>
<div class="method-definition">
<span class="method-result"><a href="../dompdf/Frame_Tree.html">Frame_Tree</a></span>
<a href="#get_tree" title="details" class="method-name">get_tree</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#load_html" title="details" class="method-name">load_html</a>
(<span class="var-type">string</span> <span class="var-name">$str</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#load_html_file" title="details" class="method-name">load_html_file</a>
(<span class="var-type">string</span> <span class="var-name">$file</span>)
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#output" title="details" class="method-name">output</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#render" title="details" class="method-name">render</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#set_base_path" title="details" class="method-name">set_base_path</a>
(<span class="var-type">string</span> <span class="var-name">$path</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#set_host" title="details" class="method-name">set_host</a>
(<span class="var-type">string</span> <span class="var-name">$host</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#set_paper" title="details" class="method-name">set_paper</a>
(<span class="var-type">string</span> <span class="var-name">$size</span>, [<span class="var-type">string</span> <span class="var-name">$orientation</span> = <span class="var-default">"portrait"</span>])
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#set_protocol" title="details" class="method-name">set_protocol</a>
(<span class="var-type">string</span> <span class="var-name">$proto</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#stream" title="details" class="method-name">stream</a>
(<span class="var-type">string</span> <span class="var-name">$filename</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#_process_html" title="details" class="method-name">_process_html</a>
()
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$_base_host" id="$_base_host"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$_base_host</span>
(line <span class="line-number">141</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Base hostname</p>
<div class="description"><p>Used for relative paths/urls</p></div>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_base_path" id="$_base_path"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$_base_path</span>
(line <span class="line-number">149</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Absolute base path</p>
<div class="description"><p>Used for relative paths/urls</p></div>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_css" id="$_css"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type"><a href="../dompdf/Stylesheet.html">Stylesheet</a></span>
<span class="var-name">$_css</span>
(line <span class="line-number">110</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Stylesheet for the document</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_paper_orientation" id="$_paper_orientation"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$_paper_orientation</span>
(line <span class="line-number">131</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Paper orientation ('portrait' or 'landscape')</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_paper_size" id="$_paper_size"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$_paper_size</span>
(line <span class="line-number">124</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Desired paper size ('letter', 'legal', 'A4', etc.)</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_pdf" id="$_pdf"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type"><a href="../dompdf/Canvas.html">Canvas</a></span>
<span class="var-name">$_pdf</span>
(line <span class="line-number">117</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Actual PDF renderer</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_protocol" id="$_protocol"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$_protocol</span>
(line <span class="line-number">156</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Protcol used to request file (file://, http://, etc)</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_tree" id="$_tree"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type"><a href="../dompdf/Frame_Tree.html">Frame_Tree</a></span>
<span class="var-name">$_tree</span>
(line <span class="line-number">103</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Frame_Tree derived from the DOM tree</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$_xml" id="$_xml"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">DomDocument</span>
<span class="var-name">$_xml</span>
(line <span class="line-number">96</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">DomDocument representing the HTML document</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">162</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Class constructor</p>
<div class="method-signature">
<span class="method-result">DOMPDF</span>
<span class="method-name">
__construct
</span>
()
</div>
</div>
<a name="methodget_base_path" id="get_base_path"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">get_base_path</span> (line <span class="line-number">226</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the base path</p>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
get_base_path
</span>
()
</div>
</div>
<a name="methodget_host" id="get_host"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">get_host</span> (line <span class="line-number">219</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the base hostname</p>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
get_host
</span>
()
</div>
</div>
<a name="methodget_protocol" id="get_protocol"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">get_protocol</span> (line <span class="line-number">212</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the protocol in use</p>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
get_protocol
</span>
()
</div>
</div>
<a name="methodget_tree" id="get_tree"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">get_tree</span> (line <span class="line-number">181</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the underlying <a href="../dompdf/Frame_Tree.html">Frame_Tree</a> object</p>
<div class="method-signature">
<span class="method-result"><a href="../dompdf/Frame_Tree.html">Frame_Tree</a></span>
<span class="method-name">
get_tree
</span>
()
</div>
</div>
<a name="methodload_html" id="load_html"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">load_html</span> (line <span class="line-number">263</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads an HTML string</p>
<div class="description"><p>Parse errors are stored in the global array _dompdf_warnings.</p></div>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
load_html
</span>
(<span class="var-type">string</span> <span class="var-name">$str</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$str</span><span class="var-description">: HTML text to load</span> </li>
</ul>
</div>
<a name="methodload_html_file" id="load_html_file"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">load_html_file</span> (line <span class="line-number">237</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads an HTML file</p>
<div class="description"><p>Parse errors are stored in the global array _dompdf_warnings.</p></div>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
load_html_file
</span>
(<span class="var-type">string</span> <span class="var-name">$file</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$file</span><span class="var-description">: a filename or url to load</span> </li>
</ul>
</div>
<a name="methodoutput" id="output"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">output</span> (line <span class="line-number">427</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the PDF as a string</p>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
output
</span>
()
</div>
</div>
<a name="methodrender" id="render"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">render</span> (line <span class="line-number">358</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Renders the HTML to PDF</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
render
</span>
()
</div>
</div>
<a name="methodset_base_path" id="set_base_path"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">set_base_path</span> (line <span class="line-number">205</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the base path</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
set_base_path
</span>
(<span class="var-type">string</span> <span class="var-name">$path</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$path</span> </li>
</ul>
</div>
<a name="methodset_host" id="set_host"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">set_host</span> (line <span class="line-number">198</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the base hostname</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
set_host
</span>
(<span class="var-type">string</span> <span class="var-name">$host</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$host</span> </li>
</ul>
</div>
<a name="methodset_paper" id="set_paper"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">set_paper</span> (line <span class="line-number">338</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the paper size & orientation</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
set_paper
</span>
(<span class="var-type">string</span> <span class="var-name">$size</span>, [<span class="var-type">string</span> <span class="var-name">$orientation</span> = <span class="var-default">"portrait"</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$size</span><span class="var-description">: 'letter', 'legal', 'A4', etc. <a href="../dompdf/CPDF_Adapter.html#var$PAPER_SIZES">CPDF_Adapter::$PAPER_SIZES</a></span> </li>
<li>
<span class="var-type">string</span>
<span class="var-name">$orientation</span><span class="var-description">: 'portrait' or 'landscape'</span> </li>
</ul>
</div>
<a name="methodset_protocol" id="set_protocol"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">set_protocol</span> (line <span class="line-number">191</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the protocol to use</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
set_protocol
</span>
(<span class="var-type">string</span> <span class="var-name">$proto</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$proto</span> </li>
</ul>
</div>
<a name="methodstream" id="stream"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">stream</span> (line <span class="line-number">417</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Streams the PDF to the client</p>
<div class="description"><p>The file will always open a download dialog.</p></div>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
stream
</span>
(<span class="var-type">string</span> <span class="var-name">$filename</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$filename</span><span class="var-description">: the name of the streamed file</span> </li>
</ul>
</div>
<a name="method_process_html" id="_process_html"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">_process_html</span> (line <span class="line-number">283</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Builds the <a href="../dompdf/Frame_Tree.html">Frame_Tree</a>, loads any CSS and applies the styles to</p>
<div class="description"><p>the <a href="../dompdf/Frame_Tree.html">Frame_Tree</a></p></div>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
_process_html
</span>
()
</div>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Fri, 04 Mar 2005 13:31:17 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
</p>
</div></body>
</html>