[76] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
| 3 | |
---|
| 4 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
| 5 | <head> |
---|
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
| 7 | |
---|
| 8 | <title>GeoExt.data.PrintProvider — GeoExt v1.0</title> |
---|
| 9 | <link rel="stylesheet" href="../../../_static/geoext.css" type="text/css" /> |
---|
| 10 | <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> |
---|
| 11 | <script type="text/javascript"> |
---|
| 12 | var DOCUMENTATION_OPTIONS = { |
---|
| 13 | URL_ROOT: '../../../', |
---|
| 14 | VERSION: '1.0', |
---|
| 15 | COLLAPSE_MODINDEX: false, |
---|
| 16 | FILE_SUFFIX: '.html', |
---|
| 17 | HAS_SOURCE: true |
---|
| 18 | }; |
---|
| 19 | </script> |
---|
| 20 | <script type="text/javascript" src="../../../_static/jquery.js"></script> |
---|
| 21 | <script type="text/javascript" src="../../../_static/doctools.js"></script> |
---|
| 22 | <link rel="shortcut icon" href="../../../_static/favicon.ico"/> |
---|
| 23 | <link rel="top" title="GeoExt v1.0" href="../../../index.html" /> |
---|
| 24 | <link rel="up" title="GeoExt.data" href="../data.html" /> |
---|
| 25 | <link rel="next" title="GeoExt.data.ProtocolProxy" href="ProtocolProxy.html" /> |
---|
| 26 | <link rel="prev" title="GeoExt.data.PrintPage" href="PrintPage.html" /> |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | </head> |
---|
| 34 | <body> |
---|
| 35 | <div class="header"> |
---|
| 36 | <div class="wrap"> |
---|
| 37 | <h1 id="logo"><a href="../../../index.html">GeoExt</a></h1> |
---|
| 38 | <ul id="top-nav"> |
---|
| 39 | <li class="first"><a href="../../../docs.html">Documentation</a></li> |
---|
| 40 | <li><a href="../../../examples.html">Examples</a></li> |
---|
| 41 | <li><a href="../../../downloads.html">Download</a></li> |
---|
| 42 | <li><a href="http://trac.geoext.org/">Development</a></li> |
---|
| 43 | </ul> |
---|
| 44 | <div id="searchbox"> |
---|
| 45 | <form class="search" action="../../../search.html" method="get"> |
---|
| 46 | <input id="searchbox-query" type="text" name="q" size="25" value="Search …" tabindex="3" onblur="if(this.value=='') this.value='Search …';" onfocus="if(this.value=='Search …') this.value='';" /> |
---|
| 47 | <input id="searchbox-submit" type="image" value="Search" src="../../../_static/img/search_icon_green.png" /> |
---|
| 48 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
| 49 | <input type="hidden" name="area" value="default" /> |
---|
| 50 | </form> |
---|
| 51 | </div> |
---|
| 52 | </div> |
---|
| 53 | </div> |
---|
| 54 | |
---|
| 55 | <div class="related"> |
---|
| 56 | <h3>Navigation</h3> |
---|
| 57 | <ul> |
---|
| 58 | <li><a href="../../../index.html">GeoExt</a> »</li> |
---|
| 59 | <li><a href="../../index.html" >API Reference</a> »</li> |
---|
| 60 | <li><a href="../data.html" accesskey="U"><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.data</span></tt></a> »</li> |
---|
| 61 | <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a></li> |
---|
| 62 | </ul> |
---|
| 63 | </div> |
---|
| 64 | |
---|
| 65 | <div class="sphinxsidebar"> |
---|
| 66 | <div class="sphinxsidebarwrapper"> |
---|
| 67 | <h3><a href="../../../index.html">Table Of Contents</a></h3> |
---|
| 68 | <ul> |
---|
| 69 | <li><a class="reference external" href="#"><tt class="docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a><ul> |
---|
| 70 | <li><a class="reference external" href="#example-use">Example Use</a></li> |
---|
| 71 | <li><a class="reference external" href="#config-options">Config Options</a></li> |
---|
| 72 | <li><a class="reference external" href="#public-properties">Public Properties</a></li> |
---|
| 73 | <li><a class="reference external" href="#public-methods">Public Methods</a></li> |
---|
| 74 | <li><a class="reference external" href="#events">Events</a></li> |
---|
| 75 | </ul> |
---|
| 76 | </li> |
---|
| 77 | </ul> |
---|
| 78 | |
---|
| 79 | <h4>Previous topic</h4> |
---|
| 80 | <p class="topless"><a href="PrintPage.html" |
---|
| 81 | title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a></p> |
---|
| 82 | <h4>Next topic</h4> |
---|
| 83 | <p class="topless"><a href="ProtocolProxy.html" |
---|
| 84 | title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.data.ProtocolProxy</span></tt></a></p> |
---|
| 85 | </div> |
---|
| 86 | </div> |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | <div class="document"> |
---|
| 90 | <div class="documentwrapper"> |
---|
| 91 | <div class="bodywrapper"> |
---|
| 92 | <div class="body"> |
---|
| 93 | |
---|
| 94 | <div class="section" id="geoext-data-printprovider"> |
---|
| 95 | <h1><a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a><a class="headerlink" href="#geoext-data-printprovider" title="Permalink to this headline">¶</a></h1> |
---|
| 96 | <dl class="meta docutils"> |
---|
| 97 | <dt>Extends</dt> |
---|
| 98 | <dd><ul class="first last simple"> |
---|
| 99 | <li><a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable">Ext.util.Observable</a></li> |
---|
| 100 | </ul> |
---|
| 101 | </dd> |
---|
| 102 | </dl> |
---|
| 103 | <dl class="class"> |
---|
| 104 | <dt id="GeoExt.data.PrintProvider"> |
---|
| 105 | <em class="property">class </em><tt class="descclassname">GeoExt.data.</tt><tt class="descname">PrintProvider</tt><a class="headerlink" href="#GeoExt.data.PrintProvider" title="Permalink to this definition">¶</a></dt> |
---|
| 106 | <dd></dd></dl> |
---|
| 107 | |
---|
| 108 | <p>Provides an interface to a Mapfish or GeoServer print module. For printing, |
---|
| 109 | one or more instances of <a title="GeoExt.data.PrintPage" class="reference external" href="PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> are also required |
---|
| 110 | to tell the PrintProvider about the scale and extent (and optionally |
---|
| 111 | rotation) of the page(s) we want to print.</p> |
---|
| 112 | <div class="section" id="example-use"> |
---|
| 113 | <h2>Example Use<a class="headerlink" href="#example-use" title="Permalink to this headline">¶</a></h2> |
---|
| 114 | <p>Minimal code to print as much of the current map extent as possible as |
---|
| 115 | soon as the print service capabilities are loaded, using the first layout |
---|
| 116 | reported by the print service:</p> |
---|
| 117 | <div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">mapPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">MapPanel</span><span class="p">({</span> |
---|
| 118 | <span class="nx">renderTo</span><span class="o">:</span> <span class="s2">"mappanel"</span><span class="p">,</span> |
---|
| 119 | <span class="nx">layers</span><span class="o">:</span> <span class="p">[</span><span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span><span class="s2">"wms"</span><span class="p">,</span> <span class="s2">"/geoserver/wms"</span><span class="p">,</span> |
---|
| 120 | <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s2">"topp:tasmania_state_boundaries"</span><span class="p">})],</span> |
---|
| 121 | <span class="nx">center</span><span class="o">:</span> <span class="p">[</span><span class="mf">146.56</span><span class="p">,</span> <span class="o">-</span><span class="mf">41.56</span><span class="p">],</span> |
---|
| 122 | <span class="nx">zoom</span><span class="o">:</span> <span class="mi">7</span> |
---|
| 123 | <span class="p">});</span> |
---|
| 124 | <span class="kd">var</span> <span class="nx">printProvider</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">data</span><span class="p">.</span><span class="nx">PrintProvider</span><span class="p">({</span> |
---|
| 125 | <span class="nx">url</span><span class="o">:</span> <span class="s2">"/geoserver/pdf"</span><span class="p">,</span> |
---|
| 126 | <span class="nx">listeners</span><span class="o">:</span> <span class="p">{</span> |
---|
| 127 | <span class="s2">"loadcapabilities"</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> |
---|
| 128 | <span class="kd">var</span> <span class="nx">printPage</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">data</span><span class="p">.</span><span class="nx">PrintPage</span><span class="p">({</span> |
---|
| 129 | <span class="nx">printProvider</span><span class="o">:</span> <span class="nx">printProvider</span> |
---|
| 130 | <span class="p">});</span> |
---|
| 131 | <span class="nx">printPage</span><span class="p">.</span><span class="nx">fit</span><span class="p">(</span><span class="nx">mapPanel</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span> |
---|
| 132 | <span class="nx">printProvider</span><span class="p">.</span><span class="nx">print</span><span class="p">(</span><span class="nx">mapPanel</span><span class="p">,</span> <span class="nx">printPage</span><span class="p">);</span> |
---|
| 133 | <span class="p">}</span> |
---|
| 134 | <span class="p">}</span> |
---|
| 135 | <span class="p">});</span> |
---|
| 136 | </pre></div> |
---|
| 137 | </div> |
---|
| 138 | </div> |
---|
| 139 | <div class="section" id="config-options"> |
---|
| 140 | <h2>Config Options<a class="headerlink" href="#config-options" title="Permalink to this headline">¶</a></h2> |
---|
| 141 | <p>Configuration properties in addition to |
---|
| 142 | those listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable">Ext.util.Observable</a>.</p> |
---|
| 143 | <dl class="describe"> |
---|
| 144 | <dt> |
---|
| 145 | <tt class="descname">autoLoad</tt></dt> |
---|
| 146 | <dd><tt class="docutils literal"><span class="pre">Boolean</span></tt> If set to true, the capabilities will be loaded upon |
---|
| 147 | instance creation, and <tt class="docutils literal"><span class="pre">loadCapabilities</span></tt> does not need to be called |
---|
| 148 | manually. Setting this when <tt class="docutils literal"><span class="pre">capabilities</span></tt> and no <tt class="docutils literal"><span class="pre">url</span></tt> is provided |
---|
| 149 | has no effect. Default is false.</dd></dl> |
---|
| 150 | |
---|
| 151 | <dl class="describe"> |
---|
| 152 | <dt> |
---|
| 153 | <tt class="descname">baseParams</tt></dt> |
---|
| 154 | <dd><tt class="docutils literal"><span class="pre">Object</span></tt> Key-value pairs of base params to be add to every |
---|
| 155 | request to the service. Optional.</dd></dl> |
---|
| 156 | |
---|
| 157 | <dl class="describe"> |
---|
| 158 | <dt> |
---|
| 159 | <tt class="descname">capabilities</tt></dt> |
---|
| 160 | <dd><tt class="docutils literal"><span class="pre">Object</span></tt> Capabilities of the print service. Only required if <tt class="docutils literal"><span class="pre">url</span></tt> |
---|
| 161 | is not provided. This is the object returned by the <tt class="docutils literal"><span class="pre">info.json</span></tt> |
---|
| 162 | endpoint of the print service, and is usually obtained by including a |
---|
| 163 | script tag pointing to |
---|
| 164 | <a class="reference external" href="http://path/to/printservice/info.json?var=myvar">http://path/to/printservice/info.json?var=myvar</a> in the head of the |
---|
| 165 | html document, making the capabilities accessible as <tt class="docutils literal"><span class="pre">window.myvar</span></tt>. |
---|
| 166 | This property should be used when no local print service or proxy is |
---|
| 167 | available, or when you do not listen for the <tt class="docutils literal"><span class="pre">loadcapabilities</span></tt> |
---|
| 168 | events before creating components that require the PrintProvider’s |
---|
| 169 | capabilities to be available.</dd></dl> |
---|
| 170 | |
---|
| 171 | <dl class="describe"> |
---|
| 172 | <dt> |
---|
| 173 | <tt class="descname">customParams</tt></dt> |
---|
| 174 | <dd><tt class="docutils literal"><span class="pre">Object</span></tt> Key-value pairs of custom data to be sent to the print |
---|
| 175 | service. Optional. This is e.g. useful for complex layout definitions |
---|
| 176 | on the server side that require additional parameters.</dd></dl> |
---|
| 177 | |
---|
| 178 | <dl class="describe"> |
---|
| 179 | <dt> |
---|
| 180 | <tt class="descname">method</tt></dt> |
---|
| 181 | <dd><tt class="docutils literal"><span class="pre">String</span></tt> Either <tt class="docutils literal"><span class="pre">POST</span></tt> or <tt class="docutils literal"><span class="pre">GET</span></tt> (case-sensitive). Method to use |
---|
| 182 | when sending print requests to the servlet. If the print service is at |
---|
| 183 | the same origin as the application (or accessible via proxy), then |
---|
| 184 | <tt class="docutils literal"><span class="pre">POST</span></tt> is recommended. Use <tt class="docutils literal"><span class="pre">GET</span></tt> when accessing a remote print |
---|
| 185 | service with no proxy available, but expect issues with character |
---|
| 186 | encoding and URLs exceeding the maximum length. Default is <tt class="docutils literal"><span class="pre">POST</span></tt>.</dd></dl> |
---|
| 187 | |
---|
| 188 | <dl class="describe"> |
---|
| 189 | <dt> |
---|
| 190 | <tt class="descname">url</tt></dt> |
---|
| 191 | <dd><tt class="docutils literal"><span class="pre">String</span></tt> Base url of the print service. Only required if |
---|
| 192 | <tt class="docutils literal"><span class="pre">capabilities</span></tt> is not provided. This |
---|
| 193 | is usually something like <a class="reference external" href="http://path/to/mapfish/print">http://path/to/mapfish/print</a> for Mapfish, |
---|
| 194 | and <a class="reference external" href="http://path/to/geoserver/pdf">http://path/to/geoserver/pdf</a> for GeoServer with the printing |
---|
| 195 | extension installed. This property requires that the print service is |
---|
| 196 | at the same origin as the application (or accessible via proxy).</dd></dl> |
---|
| 197 | |
---|
| 198 | </div> |
---|
| 199 | <div class="section" id="public-properties"> |
---|
| 200 | <h2>Public Properties<a class="headerlink" href="#public-properties" title="Permalink to this headline">¶</a></h2> |
---|
| 201 | <p>Public properties in addition to those |
---|
| 202 | listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable">Ext.util.Observable</a>.</p> |
---|
| 203 | <dl class="attribute"> |
---|
| 204 | <dt id="GeoExt.data.PrintProvider.customParams"> |
---|
| 205 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">customParams</tt><a class="headerlink" href="#GeoExt.data.PrintProvider.customParams" title="Permalink to this definition">¶</a></dt> |
---|
| 206 | <dd><tt class="docutils literal"><span class="pre">Object</span></tt> Key-value pairs of custom data to be sent to the print |
---|
| 207 | service. Optional. This is e.g. useful for complex layout definitions |
---|
| 208 | on the server side that require additional parameters.</dd></dl> |
---|
| 209 | |
---|
| 210 | <dl class="attribute"> |
---|
| 211 | <dt id="GeoExt.data.PrintProvider.dpi"> |
---|
| 212 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">dpi</tt><a class="headerlink" href="#GeoExt.data.PrintProvider.dpi" title="Permalink to this definition">¶</a></dt> |
---|
| 213 | <dd><tt class="docutils literal"><span class="pre">Ext.data.Record</span></tt> the record for the currently used resolution. |
---|
| 214 | Read-only, use <tt class="docutils literal"><span class="pre">setDpi</span></tt> to set the value.</dd></dl> |
---|
| 215 | |
---|
| 216 | <dl class="attribute"> |
---|
| 217 | <dt id="GeoExt.data.PrintProvider.dpis"> |
---|
| 218 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">dpis</tt><a class="headerlink" href="#GeoExt.data.PrintProvider.dpis" title="Permalink to this definition">¶</a></dt> |
---|
| 219 | <dd><p><tt class="docutils literal"><span class="pre">Ext.data.JsonStore</span></tt> read-only. A store representing the dpis |
---|
| 220 | available.</p> |
---|
| 221 | <p>Fields of records in this store:</p> |
---|
| 222 | <ul class="simple"> |
---|
| 223 | <li>name - <tt class="docutils literal"><span class="pre">String</span></tt> the name of the dpi</li> |
---|
| 224 | <li>value - <tt class="docutils literal"><span class="pre">Float</span></tt> the dots per inch</li> |
---|
| 225 | </ul> |
---|
| 226 | </dd></dl> |
---|
| 227 | |
---|
| 228 | <dl class="attribute"> |
---|
| 229 | <dt id="GeoExt.data.PrintProvider.layout"> |
---|
| 230 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">layout</tt><a class="headerlink" href="#GeoExt.data.PrintProvider.layout" title="Permalink to this definition">¶</a></dt> |
---|
| 231 | <dd><tt class="docutils literal"><span class="pre">Ext.data.Record</span></tt> the record of the currently used layout. Read-only, |
---|
| 232 | use <tt class="docutils literal"><span class="pre">setLayout</span></tt> to set the value.</dd></dl> |
---|
| 233 | |
---|
| 234 | <dl class="attribute"> |
---|
| 235 | <dt id="GeoExt.data.PrintProvider.layouts"> |
---|
| 236 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">layouts</tt><a class="headerlink" href="#GeoExt.data.PrintProvider.layouts" title="Permalink to this definition">¶</a></dt> |
---|
| 237 | <dd><p><tt class="docutils literal"><span class="pre">Ext.data.JsonStore</span></tt> read-only. A store representing the layouts |
---|
| 238 | available.</p> |
---|
| 239 | <p>Fields of records in this store:</p> |
---|
| 240 | <ul class="simple"> |
---|
| 241 | <li>name - <tt class="docutils literal"><span class="pre">String</span></tt> the name of the layout</li> |
---|
| 242 | <li>size - <tt class="docutils literal"><span class="pre">Object</span></tt> width and height of the map in points</li> |
---|
| 243 | <li>rotation - <tt class="docutils literal"><span class="pre">Boolean</span></tt> indicates if rotation is supported</li> |
---|
| 244 | </ul> |
---|
| 245 | </dd></dl> |
---|
| 246 | |
---|
| 247 | <dl class="attribute"> |
---|
| 248 | <dt id="GeoExt.data.PrintProvider.scales"> |
---|
| 249 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">scales</tt><a class="headerlink" href="#GeoExt.data.PrintProvider.scales" title="Permalink to this definition">¶</a></dt> |
---|
| 250 | <dd><p><tt class="docutils literal"><span class="pre">Ext.data.JsonStore</span></tt> read-only. A store representing the scales |
---|
| 251 | available.</p> |
---|
| 252 | <p>Fields of records in this store:</p> |
---|
| 253 | <ul class="simple"> |
---|
| 254 | <li>name - <tt class="docutils literal"><span class="pre">String</span></tt> the name of the scale</li> |
---|
| 255 | <li>value - <tt class="docutils literal"><span class="pre">Float</span></tt> the scale denominator</li> |
---|
| 256 | </ul> |
---|
| 257 | </dd></dl> |
---|
| 258 | |
---|
| 259 | </div> |
---|
| 260 | <div class="section" id="public-methods"> |
---|
| 261 | <h2>Public Methods<a class="headerlink" href="#public-methods" title="Permalink to this headline">¶</a></h2> |
---|
| 262 | <p>Public methods in addition to those |
---|
| 263 | listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable">Ext.util.Observable</a>.</p> |
---|
| 264 | <dl class="method"> |
---|
| 265 | <dt id="GeoExt.data.PrintProvider.loadCapabilities"> |
---|
| 266 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">loadCapabilities</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.data.PrintProvider.loadCapabilities" title="Permalink to this definition">¶</a></dt> |
---|
| 267 | <dd>Loads the capabilities from the print service. If this instance is |
---|
| 268 | configured with either <tt class="docutils literal"><span class="pre">capabilities</span></tt> or a <tt class="docutils literal"><span class="pre">url</span></tt> and <tt class="docutils literal"><span class="pre">autoLoad</span></tt> |
---|
| 269 | set to true, then this method does not need to be called from the |
---|
| 270 | application.</dd></dl> |
---|
| 271 | |
---|
| 272 | <dl class="method"> |
---|
| 273 | <dt id="GeoExt.data.PrintProvider.print"> |
---|
| 274 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">print</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.data.PrintProvider.print" title="Permalink to this definition">¶</a></dt> |
---|
| 275 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
| 276 | <col class="field-name" /> |
---|
| 277 | <col class="field-body" /> |
---|
| 278 | <tbody valign="top"> |
---|
| 279 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
| 280 | <li><em>map</em> – <tt class="docutils literal"><span class="pre">GeoExt.MapPanel</span></tt> or <tt class="docutils literal"><span class="pre">OpenLayers.Map</span></tt> The map to print.</li> |
---|
| 281 | <li><em>pages</em> – <tt class="docutils literal"><span class="pre">Array</span></tt> of <a title="GeoExt.data.PrintPage" class="reference external" href="PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> or |
---|
| 282 | <a title="GeoExt.data.PrintPage" class="reference external" href="PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> page(s) to print.</li> |
---|
| 283 | <li><em>options</em> – <tt class="docutils literal"><span class="pre">Object</span></tt> of additional options, see below.</li> |
---|
| 284 | </ul> |
---|
| 285 | </td> |
---|
| 286 | </tr> |
---|
| 287 | </tbody> |
---|
| 288 | </table> |
---|
| 289 | <p>Sends the print command to the print service and opens a new window |
---|
| 290 | with the resulting PDF.</p> |
---|
| 291 | <p>Valid properties for the <tt class="docutils literal"><span class="pre">options</span></tt> argument:</p> |
---|
| 292 | <blockquote> |
---|
| 293 | <ul> |
---|
| 294 | <li><p class="first"><tt class="docutils literal"><span class="pre">legend</span></tt> - <a title="GeoExt.LegendPanel" class="reference external" href="../widgets/LegendPanel.html#GeoExt.LegendPanel"><tt class="xref docutils literal"><span class="pre">GeoExt.LegendPanel</span></tt></a> If provided, the legend |
---|
| 295 | will be added to the print document. For the printed result to |
---|
| 296 | look like the LegendPanel, the following <tt class="docutils literal"><span class="pre">!legends</span></tt> block |
---|
| 297 | should be included in the <tt class="docutils literal"><span class="pre">items</span></tt> of your page layout in the |
---|
| 298 | print module’s configuration file:</p> |
---|
| 299 | <div class="highlight-none"><div class="highlight"><pre>- !legends |
---|
| 300 | maxIconWidth: 0 |
---|
| 301 | maxIconHeight: 0 |
---|
| 302 | classIndentation: 0 |
---|
| 303 | layerSpace: 5 |
---|
| 304 | layerFontSize: 10 |
---|
| 305 | </pre></div> |
---|
| 306 | </div> |
---|
| 307 | </li> |
---|
| 308 | <li><p class="first"><tt class="docutils literal"><span class="pre">overview</span></tt> - <tt class="xref docutils literal"><span class="pre">OpenLayers.Control.OverviewMap</span></tt> If provided, |
---|
| 309 | the layers for the overview map in the printout will be taken from |
---|
| 310 | the OverviewMap control. If not provided, the print service will |
---|
| 311 | use the main map’s layers for the overview map. Applies only for |
---|
| 312 | layouts configured to print an overview map.</p> |
---|
| 313 | </li> |
---|
| 314 | </ul> |
---|
| 315 | </blockquote> |
---|
| 316 | </dd></dl> |
---|
| 317 | |
---|
| 318 | <dl class="method"> |
---|
| 319 | <dt id="GeoExt.data.PrintProvider.setDpi"> |
---|
| 320 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">setDpi</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.data.PrintProvider.setDpi" title="Permalink to this definition">¶</a></dt> |
---|
| 321 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
| 322 | <col class="field-name" /> |
---|
| 323 | <col class="field-body" /> |
---|
| 324 | <tbody valign="top"> |
---|
| 325 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>dpi</em> – <tt class="docutils literal"><span class="pre">Ext.data.Record</span></tt> the dpi record.</td> |
---|
| 326 | </tr> |
---|
| 327 | </tbody> |
---|
| 328 | </table> |
---|
| 329 | <p>Sets the dpi for this printProvider.</p> |
---|
| 330 | </dd></dl> |
---|
| 331 | |
---|
| 332 | <dl class="method"> |
---|
| 333 | <dt id="GeoExt.data.PrintProvider.setLayout"> |
---|
| 334 | <tt class="descclassname">PrintProvider.</tt><tt class="descname">setLayout</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.data.PrintProvider.setLayout" title="Permalink to this definition">¶</a></dt> |
---|
| 335 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
| 336 | <col class="field-name" /> |
---|
| 337 | <col class="field-body" /> |
---|
| 338 | <tbody valign="top"> |
---|
| 339 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>layout</em> – <tt class="docutils literal"><span class="pre">Ext.data.Record</span></tt> the record of the layout.</td> |
---|
| 340 | </tr> |
---|
| 341 | </tbody> |
---|
| 342 | </table> |
---|
| 343 | <p>Sets the layout for this printProvider.</p> |
---|
| 344 | </dd></dl> |
---|
| 345 | |
---|
| 346 | </div> |
---|
| 347 | <div class="section" id="events"> |
---|
| 348 | <h2>Events<a class="headerlink" href="#events" title="Permalink to this headline">¶</a></h2> |
---|
| 349 | <p>Events in addition to those |
---|
| 350 | listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable">Ext.util.Observable</a>.</p> |
---|
| 351 | <dl class="describe"> |
---|
| 352 | <dt> |
---|
| 353 | <tt class="descname">beforeencodelayer</tt></dt> |
---|
| 354 | <dd><p>Triggered before a layer is encoded. This can be used to |
---|
| 355 | exclude layers from the printing, by having the listener |
---|
| 356 | return false.</p> |
---|
| 357 | <p>Listener arguments:</p> |
---|
| 358 | <ul class="simple"> |
---|
| 359 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 360 | PrintProvider</li> |
---|
| 361 | <li>layer - <tt class="docutils literal"><span class="pre">OpenLayers.Layer</span></tt> the layer which is about to be |
---|
| 362 | encoded.</li> |
---|
| 363 | </ul> |
---|
| 364 | </dd></dl> |
---|
| 365 | |
---|
| 366 | <dl class="describe"> |
---|
| 367 | <dt> |
---|
| 368 | <tt class="descname">beforeprint</tt></dt> |
---|
| 369 | <dd><p>Triggered when the print method is called.</p> |
---|
| 370 | <p>Listener arguments:</p> |
---|
| 371 | <ul class="simple"> |
---|
| 372 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 373 | PrintProvider</li> |
---|
| 374 | <li>map - <tt class="docutils literal"><span class="pre">OpenLayers.Map</span></tt> the map being printed</li> |
---|
| 375 | <li>pages - Array of <a title="GeoExt.data.PrintPage" class="reference external" href="PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> the print |
---|
| 376 | pages being printed</li> |
---|
| 377 | <li>options - <tt class="docutils literal"><span class="pre">Object</span></tt> the options to the print command</li> |
---|
| 378 | </ul> |
---|
| 379 | </dd></dl> |
---|
| 380 | |
---|
| 381 | <dl class="describe"> |
---|
| 382 | <dt> |
---|
| 383 | <tt class="descname">dpichange</tt></dt> |
---|
| 384 | <dd><p>Triggered when the dpi value is changed.</p> |
---|
| 385 | <p>Listener arguments:</p> |
---|
| 386 | <ul class="simple"> |
---|
| 387 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 388 | PrintProvider</li> |
---|
| 389 | <li>dpi - <tt class="docutils literal"><span class="pre">Ext.data.Record</span></tt> the new dpi record</li> |
---|
| 390 | </ul> |
---|
| 391 | </dd></dl> |
---|
| 392 | |
---|
| 393 | <dl class="describe"> |
---|
| 394 | <dt> |
---|
| 395 | <tt class="descname">encodelayer</tt></dt> |
---|
| 396 | <dd><p>Triggered when a layer is encoded. This can be used to modify |
---|
| 397 | the encoded low-level layer object that will be sent to the |
---|
| 398 | print service.</p> |
---|
| 399 | <p>Listener arguments:</p> |
---|
| 400 | <ul class="simple"> |
---|
| 401 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 402 | PrintProvider</li> |
---|
| 403 | <li>layer - <tt class="docutils literal"><span class="pre">OpenLayers.Layer</span></tt> the layer which is about to be |
---|
| 404 | encoded.</li> |
---|
| 405 | <li>encodedLayer - <tt class="docutils literal"><span class="pre">Object</span></tt> the encoded layer that will be |
---|
| 406 | sent to the print service.</li> |
---|
| 407 | </ul> |
---|
| 408 | </dd></dl> |
---|
| 409 | |
---|
| 410 | <dl class="describe"> |
---|
| 411 | <dt> |
---|
| 412 | <tt class="descname">layoutchange</tt></dt> |
---|
| 413 | <dd><p>Triggered when the layout is changed.</p> |
---|
| 414 | <p>Listener arguments:</p> |
---|
| 415 | <ul class="simple"> |
---|
| 416 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 417 | PrintProvider</li> |
---|
| 418 | <li>layout - <tt class="docutils literal"><span class="pre">Ext.data.Record</span></tt> the new layout</li> |
---|
| 419 | </ul> |
---|
| 420 | </dd></dl> |
---|
| 421 | |
---|
| 422 | <dl class="describe"> |
---|
| 423 | <dt> |
---|
| 424 | <tt class="descname">loadcapabilities</tt></dt> |
---|
| 425 | <dd><p>Triggered when the capabilities have finished loading. This |
---|
| 426 | event will only fire when <tt class="docutils literal"><span class="pre">capabilities</span></tt> is not configured.</p> |
---|
| 427 | <p>Listener arguments:</p> |
---|
| 428 | <ul class="simple"> |
---|
| 429 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 430 | PrintProvider</li> |
---|
| 431 | <li>capabilities - <tt class="docutils literal"><span class="pre">Object</span></tt> the capabilities</li> |
---|
| 432 | </ul> |
---|
| 433 | </dd></dl> |
---|
| 434 | |
---|
| 435 | <dl class="describe"> |
---|
| 436 | <dt> |
---|
| 437 | <tt class="descname">print</tt></dt> |
---|
| 438 | <dd><p>Triggered when the print document is opened.</p> |
---|
| 439 | <p>Listener arguments:</p> |
---|
| 440 | <ul class="simple"> |
---|
| 441 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 442 | PrintProvider</li> |
---|
| 443 | <li>url - <tt class="docutils literal"><span class="pre">String</span></tt> the url of the print document</li> |
---|
| 444 | </ul> |
---|
| 445 | </dd></dl> |
---|
| 446 | |
---|
| 447 | <dl class="describe"> |
---|
| 448 | <dt> |
---|
| 449 | <tt class="descname">printexception</tt></dt> |
---|
| 450 | <dd><p>Triggered when using the <tt class="docutils literal"><span class="pre">POST</span></tt> method, when the print |
---|
| 451 | backend returns an exception.</p> |
---|
| 452 | <p>Listener arguments:</p> |
---|
| 453 | <ul class="simple"> |
---|
| 454 | <li>printProvider - <a title="GeoExt.data.PrintProvider" class="reference internal" href="#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> this |
---|
| 455 | PrintProvider</li> |
---|
| 456 | <li>response - <tt class="docutils literal"><span class="pre">Object</span></tt> the response object of the XHR</li> |
---|
| 457 | </ul> |
---|
| 458 | </dd></dl> |
---|
| 459 | |
---|
| 460 | </div> |
---|
| 461 | </div> |
---|
| 462 | |
---|
| 463 | |
---|
| 464 | </div> |
---|
| 465 | </div> |
---|
| 466 | </div> |
---|
| 467 | <div class="clearer"></div> |
---|
| 468 | </div> |
---|
| 469 | <div class="related"> |
---|
| 470 | <h3>Navigation</h3> |
---|
| 471 | <ul> |
---|
| 472 | <li class="right" style="margin-right: 10px"> |
---|
| 473 | <a href="../../../genindex.html" title="General Index" |
---|
| 474 | accesskey="I">index</a></li> |
---|
| 475 | <li class="right" > |
---|
| 476 | <a href="../../../modindex.html" title="Global Module Index" |
---|
| 477 | accesskey="M">modules</a> |</li> |
---|
| 478 | <li class="right" > |
---|
| 479 | <a href="ProtocolProxy.html" title="GeoExt.data.ProtocolProxy" |
---|
| 480 | accesskey="N">next</a> |</li> |
---|
| 481 | <li class="right" > |
---|
| 482 | <a href="PrintPage.html" title="GeoExt.data.PrintPage" |
---|
| 483 | accesskey="P">previous</a> |</li> |
---|
| 484 | <li><a href="../../../index.html">GeoExt</a> »</li> |
---|
| 485 | <li><a href="../../index.html" >API Reference</a> »</li> |
---|
| 486 | <li><a href="../data.html" ><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.data</span></tt></a> »</li> |
---|
| 487 | <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a></li> |
---|
| 488 | </ul> |
---|
| 489 | </div> |
---|
| 490 | |
---|
| 491 | <div class="footer"> |
---|
| 492 | © Copyright 2009-2010, GeoExt Community. |
---|
| 493 | </div> |
---|
| 494 | </body> |
---|
| 495 | </html> |
---|