<div class="gmail_quote">2010/12/20 Martin Dobias <span dir="ltr"><<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>></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 <<a href="mailto:apasotti@gmail.com">apasotti@gmail.com</a>> wrote:<br>
> Hi,<br>
> I've spent a few hours exploring the codebase while I was thinking about<br>
> building a web service to generate (vectorial) PDF for a map.<br>
> IMHO this would be a must, expecially now that QGIS has entered in the web<br>
> service arena with qgis-mapserver.<br>
> The idea is to build a qgis-mapserver companion which would take care of<br>
> building a PDF representation of the map using the configured project(s) and<br>
> a print template.<br>
> The idea is that the user can configure the WMS and print template from QGIS<br>
> GUI, and have a WMS + PDF-print service running with a few clicks.<br>
> The obvious road for such a service is qgis-mapserver (read layers, map<br>
> extent etc. from request like WMS does), + qgis-print-composer (read the<br>
> template name, the resolutions and paper format from request) but it seems<br>
> 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'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'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'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>