Luca

The PDF printing is based on the FPDF library (http://www.fpdf.org/). It 
also supports links for various elements, eg. for the 'Cell' element 
that is used for the groups in the legend on the PDF printouts. See the 
documentation for 'Cell' on the FPDF site
...
Cell(float w [, float h [, string txt [, mixed border [, int ln [, 
string align [, int fill [, mixed link]]]]]]])
...

and an example at http://www.fpdf.org/en/tutorial/tuto6.php

You would have to add the link eg. in /incphp/print/pdfprint.php at 
lines 283 and 291 (version of pmapper 1.1.0) for

$this->Cell(0, 0, $grp->getDescription());

if you want a link for the group/layer.

The classes are printed as 'MultiCell' that don't seem to support links. 
If you do not need automatic line breaks you could change that to 'Cell' 
and then you get the links. The definition would be at line 317

$this->MultiCell($mcellW, $mcellH, $clsStr, 0, "L", 0);

You have to parse the "$grp->getDescription()" or "$clsStr" string and 
search for "<a href=", and if existing, extract the link destination and 
add it to the link definition of the cell.


I have also plans to add a link definition via a METADATA tag to the 
code, but very likely just for the TOC/legend and not for the printing, 
and only on the layer/group level, not for classes.

BTW: I uploaded the release 1.1.0 on sourceforge with some minor bug 
fixes compared to the last snapshot from December (mainly for problems 
with apostrophes in layer descriptions or class names).

Armin


luca marletta wrote:
> Hi All,
> I'm trying to put a link for a webpage with law and rules into the legend.
> 
> I did it such way
> CLASS
>   NAME "description of the layer <a
> href=relative_path_to_webpage/page.php target='_blank'>linkhere</a>"
> ....
> ....
> END
> 
> All works if I do as above without the ' ' for the url after href=,
> with them doesn't,
> 
> also in print page, web, all works well and it's very usefull to have
> link exactly where you are try to understand the meaning of legend
> item
> 
> The only problem is for printing in pdf because it doesn't recognise
> <a> html tag and print it as text
> 
> There is some easy changes in pdf creation to make it recognise links?
> 
> Thanks all
> 
> luca
> --
> luca marletta
> 
> _______________________________________________
> Pmapper-users mailing list
> [EMAIL PROTECTED]
> http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users
> 
> 

Reply via email to