<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Ok, so I ran some more test. Here are the results<br><br></div>I have set up a simple composer in QGIS (last master, compiled this morning)<br><a href="http://picpaste.com/Capture_du_2013-05-23_15_48_30-9NozmDib.png">http://picpaste.com/Capture_du_2013-05-23_15_48_30-9NozmDib.png</a><br>
<br></div>When I export in PDF from QGIS composer, I get this<br><a href="http://temp-share.com/show/KdPfy1yuh">http://temp-share.com/show/KdPfy1yuh</a><br><br></div>When I ran the request [1] which is the getprint (wrapped by Lizmap, but it is kind of a proxy to QGIS Server)<br>
</div>Basically I added the parameter truc=MY FOO TITLE <b>BOLD</b><br></div>I get this :<br><a href="http://temp-share.com/show/Pf3YjoO62">http://temp-share.com/show/Pf3YjoO62</a><br><br></div>When I ran the same request but with a longer "truc" parameter, like<br>
</div>&truc=MY FOO TITLE <b>BOLD</b><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque luctus adipiscing fringilla. Fusce eget justo tellus. Maecenas dolor augue, sollicitudin at iaculis et, congue et metus. Aenean tincidunt ipsum sit amet ipsum ornare fermentum. Proin fringilla laoreet hendrerit. Curabitur dui urna, interdum tempus blandit eu,</p><br>
<br></div>I get this:<br><a href="http://temp-share.com/show/f3YgiOWwn">http://temp-share.com/show/f3YgiOWwn</a><br><br></div>So it appears that the dynamic replacement via the GetPrint request does not respect the position and size of my "truc" text box. Have I missed something or shall I report a bug ?<br>
<br></div>Thanks in advance<br></div>Michael<br><div><div><div><div><div><div><div><div><br>[1] <a href="http://localhost/LIZMAP/lizmap-web-client/lizmap/www/index.php/lizmap/service/?repository=dev&project=dev_print&SERVICE=WMS&VERSION=1.3&REQUEST=GetPrint&FORMAT=pdf&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3857&DPI=300&TEMPLATE=lizmap&map0:extent=423524.8086443924,5400434.830480828,431474.979630755,5410235.04125647&map0:rotation=0&map0:scale=49999.99999999999&LAYERS=commune&truc=MY%20FOO%20TITLE%20%3Cb%3EBOLD%3C/b%3E">http://localhost/LIZMAP/lizmap-web-client/lizmap/www/index.php/lizmap/service/?repository=dev&project=dev_print&SERVICE=WMS&VERSION=1.3&REQUEST=GetPrint&FORMAT=pdf&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3857&DPI=300&TEMPLATE=lizmap&map0:extent=423524.8086443924,5400434.830480828,431474.979630755,5410235.04125647&map0:rotation=0&map0:scale=49999.99999999999&LAYERS=commune&truc=MY%20FOO%20TITLE%20%3Cb%3EBOLD%3C/b%3E</a><br>
<br></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/23 kimaidou <span dir="ltr"><<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Ok, new report here :<br><br></div><div>* Instead of using an HTML item which forces to load an external html file, I just use a classical Text item. I have checked the "Display in HTML" checkbox<br>

<br></div><div>* I setup an ID for this text box, for example "myid"<br><br></div><div>* I can request the getPrint and add the parameter and content, for example<br>...&LAYERS=commune&myid=<h1>a small test</h1><br/><br/><p>lorem ipsum blablabl</p><br>

<br></div><div>* It seems to work, but I get a tiny tiny box with some unreadble text in it.<br><br></div><div>I think I must pass some extra parameters to the fake X Server, like the screen size, etc.<br><br></div><div>
I will report further attempts<br>
<br></div><div>Cheers<br></div><div>Michael<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/23 kimaidou <span dir="ltr"><<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>I report my progress here<br><br></div>I managed to get a PDF via the GetPrint request by following these steps<br>

<br></div>1/ Create a fake X server<br>Xvfb :99 -ac -noreset &<br>
<br></div>2/ Add the option in the fastcgi , for example<br>  FastCgiConfig -idle-timeout 70 -maxClassProcesses 50 -minProcesses 3 -init-start-delay 3 -restart-delay 20 -startDelay 15 -initial-env DISPLAY=:99  LD_LIBRARY_PATH=/home/kimaidou/src/qgis/build/lib/<br>


<br></div>3/ Restart Apache<br></div>service apache2 restart<br><br><br></div><div>After this, I tried the GetPrint request from my QGIS project with a composer containing a HTML item. The request get a PDF as an answer, but the HTML item is empty.<br>


<br></div><div>I will try with another composer, etc., and report here.<br><br></div><div>By the way, is there a way to pass an HTML string via a parameter to the getPrint request for HTML items, as it is possible for text item ? This would rock !<br>


<br>Michael<br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/23 kimaidou <span dir="ltr"><<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi Tim and Marco<br><br></div>I come back to this subject after helping to solve the performance problem with Mathias.<br></div>So, I am first runnning my tests on my ubuntu laptop. Since it is my computer, it is not ubuntu server but the classical Ubuntu with an X server running.<br>



<br></div>I tried in my terminal<br></div>echo $DISPLAY<br>:0<br><br></div>So it seems (but I am far from being a X server guru !) that this is the DISPLAY value I should pass to QGIS Server.<br></div>This is why I added the following configurartion in my virtual host (and in the fastcgi config file):<br>



<br></div>In the virtual host<br>        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<br>        <Directory "/usr/lib/cgi-bin"><br>                AllowOverride None<br>                Options +ExecCGI -MultiViews FollowSymLinks<br>



                Order allow,deny<br>                Allow from all<br>                SetEnv LD_LIBRARY_PATH "/home/kimaidou/src/qgis/build/lib"<br>                SetEnv DISPLAY :0<br>        </Directory><br>



<br><br></div>In /etc/apache2/mods-available/fastcgi.conf<br><br><IfModule mod_fastcgi.c><br>  AddHandler fastcgi-script .fcgi<br>  #FastCgiWrapper /usr/lib/apache2/suexec<br>  FastCgiIpcDir /var/lib/apache2/fastcgi<br>



  FastCgiConfig -idle-timeout 70 -maxClassProcesses 50 -minProcesses 3 -init-start-delay 3 -restart-delay 20 -startDelay 15 -initial-env DISPLAY=:0 -initial-env LD_LIBRARY_PATH=/home/kimaidou/src/qgis/build/lib/<br></IfModule><br>



<br></div><div>I am pretty confident the default configuration is not used but I doubled it just in case<br></div><div><br></div>After restarting my Apache Server, QGIS Server just hangs with the very simple URL<br><a href="http://localhost/cgi-bin/qgis_mapserv.fcgi" target="_blank">http://localhost/cgi-bin/qgis_mapserv.fcgi</a><br>



</div>which should reply with an error in XML format.<br></div><div>So it seems Apache/QGIServer do not like my DISPLAY parameter.<br></div><div><br></div>Any hint ?<br></div>Would it be simplier to test this in a real server with no existing X Server by using Xfvb ?<br>



<br></div>Michael<br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/22 Tim Sutton <span dir="ltr"><<a href="mailto:lists@linfiniti.com" target="_blank">lists@linfiniti.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
You might also want to consider using Xfvb as a 'fake' xserver.<br>
<br>
Regards<br>
<br>
Tim<br>
<div><div><br>
On Wed, May 22, 2013 at 10:19 AM, kimaidou <<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>> wrote:<br>
> Thanks for your answer Marco. I will try to use the workaround you described<br>
> and report progress here.<br>
><br>
> Michael<br>
><br>
><br>
> 2013/5/22 Marco Hugentobler <<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a>><br>
>><br>
>> Hi Michael<br>
>><br>
>> I also encountered that problem. Unfortunately, it seems that QWebKit<br>
>> requires a running x-server. So it won't be possible to use html items in<br>
>> server projects (or you can run an x-server and set the DISPLAY variable in<br>
>> the fcgi conf).<br>
>><br>
>> Regards,<br>
>> Marco<br>
>><br>
>> On 22.05.2013 09:43, kimaidou wrote:<br>
>><br>
>> Hi list<br>
>><br>
>> I have tried it with today's qgis master.<br>
>><br>
>> I have a very simple project with one shapefile containing 3 polygones. I<br>
>> created a composer with a map. GetPrint request works fine with it. If I add<br>
>> an HTML block in the composer (refering to one HTML file or not), the<br>
>> getPrint request raises a segfault.<br>
>><br>
>> Apache error log is the well-known :<br>
>> "Premature end of script headers: qgis_mapserv2.fcgi"<br>
>><br>
>> By the way, I compiled QGIS with -DCMAKE_BUILD_TYPE=debug , but I do not<br>
>> know where I can find complet log for QGIS Server. Is there a file where I<br>
>> can get complete log for QGIS Server ?<br>
>><br>
>> I can provide a sample project if needed. I have not found a ticket in the<br>
>> hub, so I will fill one, but I would prefer to do so with a self-explaining<br>
>> log.<br>
>><br>
>> Michael<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> Dr. Marco Hugentobler<br>
>> Sourcepole -  Linux & Open Source Solutions<br>
>> Weberstrasse 5, CH-8004 Zürich, Switzerland<br>
>> <a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a> <a href="http://www.sourcepole.ch" target="_blank">http://www.sourcepole.ch</a><br>
>> Technical Advisor QGIS Project Steering Committee<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
<br>
<br>
<br>
--<br>
</div></div>Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)<br>
==============================================<br>
Please do not email me off-list with technical<br>
support questions. Using the lists will gain<br>
more exposure for your issues and the knowledge<br>
surrounding your issue will be shared with all.<br>
<br>
Visit <a href="http://linfiniti.com" target="_blank">http://linfiniti.com</a> to find out about:<br>
 * QGIS programming and support services<br>
 * Mapserver and PostGIS based hosting plans<br>
 * FOSS Consulting Services<br>
Skype: timlinux<br>
Irc: timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a><br>
==============================================<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>