[Cartoweb-users] exportPdf: relative url for logo

Alexandre Saunier alexandre.saunier at camptocamp.com
Fri Dec 16 09:22:28 EST 2005


As you quoted it, you may use paths relative to the CartoWeb root. In 
your case "c:\wamp\www\cartoweb3".

If you want to include images stored in one of your projects you must 
specify the project path in the image path as well.
In your case: "projects/projectname/htdocs/gfx/layout/img.png"
which results in the following absolute path:
"c:\wamp\www\cartoweb3\projects/projectname/htdocs/gfx/layout/img.png"

If you only specify "htdocs/gfx/layout/img.png" (path basis is the 
*project* root and not the CartoWeb one), you get:
"c:\wamp\www\cartoweb3\htdocs/gfx/layout/img.png"
which is obviously incorrect in your case.
That's the reason why FPDF failed retrieving the file...

The doc example is given for an image located in the general htdocs/ 
directory.

Emmanuel Belo wrote:
> Hello,
> 
> is it true that in exportPdf.ini it should be written instead of:
> 
> blocks.logo.content = "projects/projectname/htdocs/gfx/layout/img.png"
> 
> this:
> 
> blocks.logo.content = "htdocs/gfx/layout/img.png"
> 
> ?
> 
> In the documentation, it is written (12.3.3.4): "It is also possible to 
> use a relative file path based on the CartoClient root directory (eg. 
> htdocs/gfx/layout/c2c.png)."
> 
> The problem is that if i use the second relative url, this error occurs:
> 
> message:   Error [2, 
> fopen(c:\wamp\www\cartoweb3/htdocs/gfx/layout/img.png) [function.fopen]: 
> failed to open stream: No such file or directory, 
> c:\wamp\www\cartoweb3\include\fpdf\fpdf.php, 1522]
> 
> My image is there: 
> c:\wamp\www\cartoweb3/projects/projectname/htdocs/gfx/layout/img.png
> 
> 
> The first works fine, but this is not really clean...
> 
> 
> Best regards,
> 
> Emmanuel Belo



More information about the Cartoweb-users mailing list