<div class="gmail_quote">2010/12/20 Martin Dobias <span dir="ltr">&lt;<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Alessandro<br>
<div class="im"><br>
On Mon, Dec 20, 2010 at 2:47 PM, Alessandro Pasotti &lt;<a href="mailto:apasotti@gmail.com">apasotti@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt; I&#39;ve spent a few hours exploring the codebase while I was thinking about<br>
&gt; building a web service to generate (vectorial) PDF for a map.<br>
&gt; IMHO this would be a must, expecially now that QGIS has entered in the web<br>
&gt; service arena with qgis-mapserver.<br>
&gt; The idea is to build a qgis-mapserver companion which would take care of<br>
&gt; building a PDF representation of the map using the configured project(s) and<br>
&gt; a print template.<br>
&gt; The idea is that the user can configure the WMS and print template from QGIS<br>
&gt; GUI, and have a  WMS + PDF-print service running with a few clicks.<br>
&gt; The obvious road for such a service is qgis-mapserver (read layers, map<br>
&gt; extent etc. from request like WMS does), + qgis-print-composer (read the<br>
&gt; template name, the resolutions and paper format from request) but it seems<br>
&gt; like the print-composer cannot work without a GUI, is this correct ?<br>
<br>
</div>Marco has refactored the composer code few releases ago, so now it&#39;s<br>
possible to use the print composer by calling only qgis_core code.<br>
There is also a simple example how to use the composer:<br>
<br>
<a href="http://www.qgis.org/pyqgis-cookbook/composer.html#output-using-map-composer" target="_blank">http://www.qgis.org/pyqgis-cookbook/composer.html#output-using-map-composer</a><br>
<br>
The code saves only a raster image, though saving a PDF should require<br>
only minor modifications of that code. If you will have any problems<br>
adapting it, I&#39;ll try to provide also PDF example.<br>
<br>
Regards<br>
<font color="#888888">Martin<br>
</font></blockquote></div><div><br></div><div><br></div>Thanks Martin,<div><br></div><div>I have already found your example, but it is for a plugin, isn&#39;t it ?</div><div><br></div><div>I remember I tried to make it work from outside qgis (standalone) without success.<br>
<br></div><div>What I would like to achieve is a CGI-style application which takes WMS-like parameters (like qgis-mapserver does) and a printcomposer template to generate a (vectorial) PDF.</div><div><br clear="all"><br>-- <br>
Alessandro Pasotti<br>w3:   <a href="http://www.itopen.it">www.itopen.it</a><br>
</div>