svn commit: r41 - trunk/mapbender/http/print

uli at osgeo.org uli at osgeo.org
Thu Apr 13 16:50:52 EDT 2006


Author: uli
Date: 2006-04-13 20:50:52+0000
New Revision: 41

Added:
   trunk/mapbender/http/print/mod_printPDF.php
   trunk/mapbender/http/print/mod_printPDF_pdf.php
   trunk/mapbender/http/print/printPDF.conf
   trunk/mapbender/http/print/printPDF_b.conf

Log:
import Mapbender source without history

Added: trunk/mapbender/http/print/mod_printPDF.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/print/mod_printPDF.php?view=auto&rev=41
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/print/mod_printPDF.php	2006-04-13 20:50:52+0000
@@ -0,0 +1,367 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+session_start();
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Print PDF</title>
+</head>
+<style type="text/css">
+<!-- 
+select{
+   width:150px;
+} 
+input{
+	width:150px;
+}
+.mycheck{
+	width:15px;
+}
+div{
+	font-family : Arial, Helvetica, sans-serif;
+	font-size: 12px;
+}
+-->
+</style>
+<?php
+
+
+require_once("../print/".$_REQUEST["conf"]);
+echo "<script type='text/javascript'>";
+echo "var target = '".$_REQUEST["target"]."';";
+echo "var comment = '".$label_comment."';";
+echo "var comment_length = ".$comment_length.";";
+echo "var label_button = '".$label_button."';";
+echo "var type = '".$type."';";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+
+
+var size;
+var format;
+var map_width;
+var map_height;
+
+if(type=='window'){
+	var pt = window.opener;
+}
+else if(type == 'iframe'){
+	var pt = parent;
+}
+
+function mod_legend_print(){
+	var mod_legend_target = target;
+	var ind = pt.getMapObjIndexByName(mod_legend_target);
+	var layers;
+
+	document.forms[0].layers.value = "";
+	document.forms[0].wms_id.value = "";
+	document.forms[0].wms_title.value = "";
+	document.forms[0].legendurl.value = "";
+	
+
+	
+	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+		layers = pt.mb_checkScale(mod_legend_target,ind,i);
+		var layer = layers[0].split(",");
+		var title = layers[2].split(",");
+		var temp_legendurl = layers[3].split(",");
+		var layerparent= layers[4].split(",");
+
+		if(pt.mb_mapObj[ind].wms[i].wms_getlegendurl != "" && pt.mb_mapObj[ind].layers[i] != "" && pt.mb_mapObj[ind].layers[i]){
+
+		   if(i>0){
+		    document.forms[0].layers.value += "___";
+		    document.forms[0].wms_id.value += "___";
+		    document.forms[0].wms_title.value += "___";
+		    document.forms[0].legendurl.value += "___";
+			}
+			
+			//document.forms[0].layers.value += pt.mb_mapObj[ind].wms[i].objLayer[ii].layer_title; //pt.mb_mapObj[ind].layers[i]	;
+			
+			document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;   
+			document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
+			
+			//---------- legendurl ----------
+			tmp_name = "";
+			for(var j=0; j<layer.length; j++){
+			 if(layerparent[j] == 0){
+				if(j>0){
+					document.forms[0].layers.value += ",";
+				}
+
+				var l = pt.mb_getchildsbyname(ind,i,layer[j]);
+				
+
+				
+				//prompt ("l: ",l);
+
+			 	if (l) {
+			 		document.forms[0].layers.value += title[j];
+
+			 		if(j>0){
+						document.forms[0].legendurl.value += ",";
+					}
+					for (var k=0; k<l["name"].length; k++){
+				 		if (tmp_name != l["title"][k]) {
+				 		    document.forms[0].layers.value += "*"
+				 			if(k>0){
+				 				 document.forms[0].legendurl.value += "*";
+				 			}else{
+				 				 document.forms[0].legendurl.value += '1*';
+				 			}
+							//prompt (l["name"].length+"l: " ,tmp_name+"---"+l["legendurl"][k]);
+							
+							if (l["legendurl"][k] != '' || !l["legendurl"][k]==true){
+								document.forms[0].layers.value += l["name"][k];
+				  				document.forms[0].legendurl.value += l["legendurl"][k];
+							}else{
+								document.forms[0].layers.value += '0';
+								document.forms[0].legendurl.value += '0';
+							}
+							tmp_name = l["title"][k];
+				 		}	// if
+					 } // for var k=0
+
+				} // if (l) 
+				else{
+					//prompt (!temp_legendurl[j] ,temp_legendurl[j] + !temp_legendurl[j]);
+
+						document.forms[0].layers.value += title[j];
+						if(j>0){
+							document.forms[0].legendurl.value += ",";
+						}
+						if (temp_legendurl[j]!= '' || !temp_legendurl[j] == 'true'){
+							document.forms[0].legendurl.value += temp_legendurl[j];
+						}else{
+							document.forms[0].legendurl.value +='0';
+						}
+					
+				}// else (l) 
+			   }//check parent==0
+			}//for var j=0
+			
+			//-------------------
+
+			//document.forms[0].legendurl.value += layers[3];
+	
+		} else{
+			 if(i>0){
+		    document.forms[0].layers.value += "___";
+		    document.forms[0].wms_id.value += "___";
+		    document.forms[0].wms_title.value += "___";
+		    document.forms[0].legendurl.value += "___";
+			}
+			
+			document.forms[0].layers.value += "0";
+		    document.forms[0].wms_id.value += "0";
+		    document.forms[0].wms_title.value += "0";
+		    document.forms[0].legendurl.value += "0";
+		}
+	}
+}
+
+function validate(){
+	size = document.form1.size.options[document.form1.size.selectedIndex].value;
+	format = document.form1.format.options[document.form1.format.selectedIndex].value;
+	if(size != "" && format != ""){
+		var ind = pt.getMapObjIndexByName(target);
+		var coord = pt.mb_mapObj[ind].extent.split(",");
+		var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
+		var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
+		if(size == "A4" && format == "portrait"){
+			map_width = <?php echo $a4p_map_width; ?>; 
+			map_height = <?php echo $a4p_map_height; ?>; 
+		}
+		if(size == "A4" && format == "landscape"){
+			map_width = <?php echo $a4l_map_width; ?>;
+			map_height = <?php echo $a4l_map_height; ?>; 
+		}
+		if(size == "A3" && format == "portrait"){
+			map_width = <?php echo $a3p_map_width; ?>;
+			map_height = <?php echo $a3p_map_height; ?>;
+		}
+		if(size == "A3" && format == "landscape"){
+			map_width = <?php echo $a3l_map_width; ?>;
+			map_height = <?php echo $a3l_map_height; ?>;
+		}     
+		var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
+		pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+
+		pt.mb_mapObj[ind].width = Math.round(map_width);
+		pt.mb_mapObj[ind].height = Math.round(map_height);
+		pt.document.getElementById(target).style.width = Math.round(map_width);
+		pt.document.getElementById(target).style.height = Math.round(map_height);
+		pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
+		pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
+
+		//pt.setMapRequest(target);		
+		pt.mb_repaintScale(target, null, null, pt.mb_getScale(target));
+      	document.form1.map_url.value = '';
+		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+			if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+				if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
+					if(document.form1.map_url.value != ""){
+						document.form1.map_url.value += "___";
+					}         
+					document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+				}
+			}
+		}
+		
+		//overview_url
+		var ind_overview = pt.getMapObjIndexByName('overview');
+
+		//alert ("länge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
+		if(pt.mb_mapObj[ind_overview].mapURL != false ){
+			document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
+		}
+	}
+}
+function refreshParams(){
+	var ind = pt.getMapObjIndexByName(target);
+	var f = document.form1;
+	f.map_url.value = "";
+	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+			if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
+				if(f.map_url.value != ""){
+					f.map_url.value += "___";
+				}      
+				f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+			}
+		}
+	}
+	f.map_scale.value = pt.mb_getScale(target);
+	mod_legend_print();
+}
+function printMap(){
+	if(size != "" && (format == "portrait" || format == "landscape")){
+		refreshParams();
+		if(document.form1.c1.value != comment){
+			document.form1.comment1.value = document.form1.c1.value;
+		}
+		if(document.form1.c2.value != comment){
+			document.form1.comment2.value = document.form1.c2.value;
+		}
+		if(document.form1.mylegendcheckbox.checked == 0){
+			document.form1.mylegend.value = 'false';
+		}else{
+			document.form1.mylegend.value = 'true';
+		}
+		
+		document.form1.submit();
+	}
+	else{
+		alert("Das Format ist noch nicht ausgewählt.");
+	}
+}
+function valCom(obj){
+	if(obj.value.length > comment_length){
+		obj.value = obj.value.substr(0,comment_length);
+	}
+}
+// -->
+</script>
+<body>
+<form name='form1' method='POST' action='../print/mod_printPDF_pdf.php?<?php echo SID; ?>' target="_blank">
+<table border='0'>
+<tr>
+	<td>
+	<select name='size' onchange='validate()'>
+<?php
+	if($a4 == true && $a3 == true){
+		echo "<option value=''>".$label_format."</option>";
+	}
+	if($a4 == true){
+		echo "<option value='A4'>".$label_format_a4."</option>";
+	}
+	if($a3 == true){
+		echo "<option value='A3'>".$label_format_a3."</option>";
+	}
+?>
+	</select>
+	</td>   
+</tr>
+<tr>
+	<td>
+	<select name='format' onchange='validate()'>
+	<option value=''><?php echo $label_orientation; ?></option>
+	<option value='portrait'><?php echo $label_portrait; ?></option>
+	<option value='landscape'><?php echo $label_landscape; ?></option>
+	</select>
+	</td>
+</tr>
+<?php
+if($highquality == true){
+	echo "<tr>";
+		echo "<td>";
+		echo "<select name='quality'>";
+		echo "<option value='1'>".$label_72dpi."</option>";
+		echo "<option value='2'>".$label_288dpi."</option>";
+		echo "</select>";
+		echo "</td>";
+	echo "</tr>";
+}
+?>
+<tr>
+	<td>
+		<input type='text' name='c1' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
+	</td>
+</tr>
+<tr>
+	<td>
+		<input type='text' name='c2' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
+	</td>
+</tr>
+<?php
+if($legend == true){
+	echo "<tr>";
+		echo "<td>";
+		echo "<div><input type='checkbox' class='mycheck' name='mylegendcheckbox' value='false'>".$label_legend."</div>";
+		echo "</td>";
+	echo "</tr>";
+}
+?>
+<table>  
+<input type='hidden' name='map_url' value=''>
+<input type='hidden' name='overview_url' value=''>
+<input type='hidden' name='wms_title' value=''>
+<input type='hidden' name='wms_id' value=''>
+<input type='hidden' name='layers' value=''>
+<input type='hidden' name='legendurl' value=''>
+<input type='hidden' name='map_scale' value=''>
+<input type='button' name='print' value="<?php echo $label_button; ?>" onclick='printMap()'>
+<input type='hidden' name='conf' value='<?php echo $_REQUEST["conf"]; ?>'>
+<input type='hidden' name='comment1' value=''>
+<input type='hidden' name='comment2' value=''>
+<input type='hidden' name='mylegend' value='true'>
+
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/print/mod_printPDF_pdf.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/print/mod_printPDF_pdf.php?view=auto&rev=41
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php	2006-04-13 20:50:52+0000
@@ -0,0 +1,697 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#require_once("../php/mb_validateSession.php");
+ob_start();
+session_start();
+ini_set('error_reporting', 'E_ALL & ~ E_NOTICE');
+include ('../classes/class.ezpdf.php');
+include ('../classes/class_stripRequest.php');
+include ('../classes/class_weldMaps2PNG.php');
+include ('../classes/class_weldOverview2PNG.php');
+include ('../print/'.$_REQUEST["conf"]);
+include ('../classes/class_SaveLegend.php');
+if($log == true){
+	include ('../classes/class_log.php');
+}
+
+#Globals
+
+$factor = intval($_REQUEST["quality"]);
+
+#$date = date("d.m.Y",strtotime("now"));
+$linewidth_dashed = 0.5;
+$linewidth = 0.5;
+
+// DURATION TIME:
+function microtime_float(){
+   list($usec, $sec) = explode(" ", microtime());
+   return ((float)$usec + (float)$sec);
+}
+$time_start = microtime_float();
+// END DURATION TIME
+
+$time_end = microtime_float();
+$time = $time_end - $time_start;
+
+/* -------------------------------------- */
+
+$size = $_REQUEST["size"];
+$format = $_REQUEST["format"];
+$map_scale = $_REQUEST["map_scale"];
+$overview_url = $_REQUEST["overview_url"];
+
+function setscalebar($scale){
+    	$mb_resolution = 28.35;
+        
+		if($scale < 16){
+	      $value = "10";
+	      $unit = "cm";
+	      $scalefactor = 10/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale >= 16 && $scale < 151){
+	      $value = "1";	      
+	      $unit = "Meter";
+	      $scalefactor = 100/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale >= 151 && $scale < 1550 ){
+	      $value = "10";	      
+	      $unit = "Meter";
+	      $scalefactor = 1000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale >= 1550 && $scale < 15050){
+	      $value = "100";	      
+	      $unit = "Meter";
+	      $scalefactor = 10000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale < 150050 && $scale >= 15050){
+	      $value = "1";	      
+	      $unit = "Kilometer";
+	      $scalefactor = 100000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale < 1500050 && $scale >= 150050){
+	      $value = "10";	      
+	      $unit = "Kilometer";
+	      $scalefactor = 1000000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale < 15000050 && $scale >= 1500050){
+	      $value = "100";	      
+	      $unit = "Kilometer";
+	      $scalefactor = 10000000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale < 150000001 && $scale >= 15000001){
+	      $value = "1000";	      
+	      $unit = "Kilometer";
+	      $scalefactor = 100000000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }
+	   if($scale >= 150000001){
+	      $value = "1000";	      
+	      $unit = "Kilometer";
+	      $scalefactor = 100000000/$scale;
+	      $img_width = round($scalefactor * $mb_resolution);
+	   }   
+	   $array_scale[0] = $unit;
+	   $array_scale[1] = $img_width;
+		$array_scale[2] = $value;	   
+	   
+	   return  $array_scale; 
+}
+
+
+$border = 0.8 * $DPC;
+
+if($matching == true){
+   $urls = str_replace($pattern,$replacement,$_REQUEST["map_url"]);  
+}
+else{
+   $urls = $_REQUEST["map_url"];
+}
+
+
+$array_urls = explode("___", $urls);
+
+$myURL = new stripRequest($array_urls[0]);
+$map_width = round($myURL->get("width"));
+$map_height = round($myURL->get("height"));
+$map_extent = $myURL->get("BBOX");
+if($factor>1){
+	for($i=0; $i<count($array_urls); $i++){
+		$m = new stripRequest($array_urls[$i]);
+		$m->set('width',(intval($m->get('width'))*4));
+		$m->set('height',(intval($m->get('height'))*4));
+		if(in_array($m->get('map'),$highqualitymapfiles)){	
+			$m->set('map',str_replace(".map","_4.map",$m->get('map')));			
+		}
+		$array_urls[$i] = $m->url;
+	}
+}
+$coord = split(",",$map_extent);
+
+// analyse overview url and draw rectangle with position
+$o_url = new stripRequest($overview_url);
+$overview_width = round($o_url->get("width"));
+$overview_height = round($o_url->get("height"));
+
+if($factor>1){
+	$o_url->set('width',(intval($o_url->get('width'))*4));
+	$o_url->set('height',(intval($o_url->get('height'))*4));
+	if(in_array($o_url->get('map'),$highqualitymapfiles)){	
+			$o_url->set('map',str_replace(".map","_4.map",$o_url->get('map')));		
+			$overview_url = $o_url->url;	
+	}
+}
+
+if ($size == "A4" && $format == "portrait"){
+	$overview_left = $a4p_overviewOffset_left;
+	$overview_bottom =$a4p_overviewOffset_bottom;
+}elseif ($size == "A4" && $format == "landscape"){
+	$overview_left = $a4l_overviewOffset_left;
+	$overview_bottom =$a4l_overviewOffset_bottom;
+}elseif ($size == "A3" && $format == "portrait"){
+	$overview_left = $a3p_overviewOffset_left;
+	$overview_bottom =$a3p_overviewOffset_bottom;
+}elseif ($size == "A3" && $format == "landscape"){
+	$overview_left = $a3l_overviewOffset_left;
+	$overview_bottom = $a3l_overviewOffset_bottom;
+}
+
+$o_extent = $o_url->get("BBOX");
+
+/*
+$o_new = new stripRequest($overview_url);
+$o_new->set('width',50);
+$o_new->set('height',50);
+//$o->set('BBOX',$overview_extent);
+$o_url_new =$o_new->url;
+$array_overview[0] = $overview_url;
+$array_overview[1] = $o_url;
+*/
+
+/*
+ * north arrow
+ */
+if($size == "A4" && $format == "portrait"){
+	$northarrow_left = $a4p_northarrow_left;
+	$northarrow_bottom = $a4p_northarrow_bottom;
+}elseif ($size == "A4" && $format == "landscape"){
+	$northarrow_left = $a4l_northarrow_left;
+	$northarrow_bottom = $a4l_northarrow_bottom;
+}elseif ($size == "A3" && $format == "portrait"){
+	$northarrow_left = $a3p_northarrow_left;
+	$northarrow_bottom = $a3p_northarrow_bottom;
+}elseif ($size == "A3" && $format == "landscape"){
+	$northarrow_left = $a3l_northarrow_left;
+	$northarrow_bottom = $a3l_northarrow_bottom;
+}
+
+/*
+ * special image
+ */
+if ($size == "A4" && $format == "portrait"){
+	$specialImage_left = $a4p_special_left;
+	$specialImage_bottom = $a4p_special_bottom;
+}elseif ($size == "A4" && $format == "landscape"){
+	$specialImage_left = $a4l_special_left;
+	$specialImage_bottom = $a4l_special_bottom;
+}elseif ($size == "A3" && $format == "portrait"){
+	$specialImage_left = $a3p_special_left;
+	$specialImage_bottom = $a3p_special_bottom;
+}elseif ($size == "A3" && $format == "landscape"){
+	$specialImage_left = $a3l_special_left;
+	$specialImage_bottom = $a3l_special_bottom;
+}
+
+if($log == true){
+	$l = new log("printPDF",$array_urls);
+}
+$pdf = new Cezpdf();
+
+$pdf->Cezpdf(strtolower($size),$format);
+$diff=array(196=>'Adieresis',228=>'adieresis',
+   214=>'Odieresis',246=>'odieresis',
+   220=>'Udieresis',252=>'udieresis',
+   223=>'germandbls');
+$pdf->selectFont('../classes/fonts/Helvetica.afm', array('encoding'=>'WinAnsiEncoding','differences'=>$diff));
+if($size == "A4" && $format == "portrait"){
+	$mapOffset_left = $a4p_mapOffset_left;
+	$mapOffset_bottom = $a4p_mapOffset_bottom;
+	$header_height = $a4p_header_height;
+	$footer_height = $a4p_footer_height;
+}
+else{
+	$mapOffset_left = $a4l_mapOffset_left;
+	$mapOffset_bottom = $a4l_mapOffset_bottom;
+	$header_height = $a4l_header_height;
+	$header_width = $a4l_header_width;
+}
+
+$i = new weldMaps2PNG(implode("___",$array_urls),$filename);
+
+$pdf->addPngFromFile($filename, $mapOffset_left, $mapOffset_bottom, $map_width, $map_height);
+if($unlink == true){
+	unlink($filename);
+}
+
+
+# dashed line
+$pdf->setLineStyle($linewidth_dashed, '','', array(2,2));
+$pdf->line($mapOffset_left - $linewidth_dashed, $mapOffset_bottom - $linewidth_dashed, $mapOffset_left - $linewidth_dashed, $mapOffset_bottom  + $map_height + $linewidth_dashed);
+$pdf->line($mapOffset_left - $linewidth_dashed, $mapOffset_bottom  + $map_height + $linewidth_dashed, $mapOffset_left + $map_width + $linewidth_dashed, $mapOffset_bottom + $map_height + $linewidth_dashed);
+$pdf->line($mapOffset_left + $map_width + $linewidth_dashed, $mapOffset_bottom + $map_height + $linewidth_dashed, $mapOffset_left + $map_width + $linewidth_dashed, $mapOffset_bottom -$linewidth_dashed);
+$pdf->line($mapOffset_left + $map_width + $linewidth_dashed, $mapOffset_bottom -$linewidth_dashed, $mapOffset_left - $linewidth_dashed, $mapOffset_bottom - $linewidth_dashed);
+
+
+#line
+$pdf->setLineStyle($linewidth, '', '', array());
+$pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border, $mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border);
+$pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border, $mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border);
+$pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border, $mapOffset_left + $map_width + $border, $mapOffset_bottom -$border);
+$pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom -$border, $mapOffset_left - $border, $mapOffset_bottom - $border);
+
+
+if($size == "A4" && $format == "portrait"){
+   #header:
+   $pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border, $mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border + $header_height);
+   $pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border + $header_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom  + $map_height + $border + $header_height);
+   $pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom  + $map_height + $border + $header_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom  + $map_height + $border);
+   $pdf->line( $mapOffset_left + $map_width/2, $mapOffset_bottom  + $map_height + $border, $mapOffset_left + $map_width/2, $mapOffset_bottom  + $map_height + $border + $header_height);
+   #header-text
+   $mySize = 9;
+   $length = $pdf->getTextWidth($mySize, $text1);
+   $pdf->addText($mapOffset_left - ($border/2) + ($map_width/4) - ($length/2),$mapOffset_bottom + $map_height + $border + 60,$mySize,$text1);
+
+   $mySize = 8;
+   $length = $pdf->getTextWidth($mySize, $text2);   
+   $pdf->addText($mapOffset_left - ($border/2) + ($map_width/4) - ($length/2),$mapOffset_bottom + $map_height + $border + 45,$mySize,$text2);
+   
+   $length = $pdf->getTextWidth($mySize, $text3);
+   $pdf->addText($mapOffset_left - ($border/2) + ($map_width/4) - ($length/2),$mapOffset_bottom + $map_height + $border + 35,$mySize,$text3);
+
+   $mySize = 9;
+   $length = $pdf->getTextWidth($mySize, $text4);   
+   $pdf->addText($mapOffset_left - ($border/2) + ($map_width/4) - ($length/2),$mapOffset_bottom + $map_height + $border + 20,$mySize,$text4);
+
+   $mySize = 8;
+   $length = $pdf->getTextWidth($mySize, $text5);   
+   $pdf->addText($mapOffset_left - ($border/2) + ($map_width/4) - ($length/2),$mapOffset_bottom + $map_height + $border + 10,$mySize,$text5);
+   
+   $mySize = 9;
+   $length = $pdf->getTextWidth($mySize, $text6);   
+   $pdf->addText($mapOffset_left + ($border/2) + ($map_width/4*3) - ($length/2),$mapOffset_bottom + $map_height + $border + 60,$mySize,$text6);
+   $length = $pdf->getTextWidth($mySize, $text7);   
+   $pdf->addText($mapOffset_left + ($border/2) + ($map_width/4*3) - ($length/2),$mapOffset_bottom + $map_height + $border + 50,$mySize,$text7);
+   $length = $pdf->getTextWidth($mySize, $text8);   
+   $pdf->addText($mapOffset_left + ($border/2) + ($map_width/4*3) - ($length/2),$mapOffset_bottom + $map_height + $border + 30,$mySize,$text8);
+   $length = $pdf->getTextWidth($mySize, $text9);   
+   $pdf->addText($mapOffset_left + ($border/2) + ($map_width/4*3) - ($length/2),$mapOffset_bottom + $map_height + $border + 20,$mySize,$text9);
+   $length = $pdf->getTextWidth($mySize, $text10);   
+   $pdf->addText($mapOffset_left + ($border/2) + ($map_width/4*3) - ($length/2),$mapOffset_bottom + $map_height + $border + 10,$mySize,$text10);
+   
+   //special image on the map-page
+   if ($special == true){
+   	$pdf->addPngFromFile($specialImage, $specialImage_left, $specialImage_bottom , $specialImage_width, $specialImage_height);
+   }
+   
+   #footer
+   $pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border, $mapOffset_left - $border, $mapOffset_bottom - $border - $footer_height);
+   $pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border - $footer_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom - $border - $footer_height);
+   $pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom - $border - $footer_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom - $border);
+   
+   $mySize = 8;
+   $length = $pdf->getTextWidth($mySize, $text11);   
+   $pdf->addText( $mapOffset_left + $map_width/2 - ($length/2),$mapOffset_bottom - $border - 10,$mySize,$text11);
+   $mySize = 6;
+   $length = $pdf->getTextWidth($mySize, $text12);   
+   $pdf->addText( $mapOffset_left + $map_width/2 - ($length/2),$mapOffset_bottom - $border - 18,$mySize,$text12);
+   $length = $pdf->getTextWidth($mySize, $text13);
+   $pdf->addText( $mapOffset_left + $map_width/2 - ($length/2),$mapOffset_bottom - $border - 25,$mySize,$text13);
+}
+else{
+   $pdf->setColor(1,1,1);
+   $ll = array($mapOffset_left + $map_width - $header_width + $border - $linewidth, $mapOffset_bottom - $border + 1);
+   $pdf->filledRectangle($ll[0], $ll[1], $header_width,$header_height);
+   $pdf->line($ll[0], $ll[1], $ll[0], $ll[1] + $header_height);
+   $pdf->line($ll[0], $ll[1] + $header_height, $ll[0] + $header_width, $ll[1] + $header_height);
+
+   $pdf->line($ll[0] + 2, $ll[1] + 2, $ll[0] + 2,  $ll[1] + $header_height - 2);
+   $pdf->line($ll[0] + 2,  $ll[1] + $header_height - 2, $ll[0] - 2 + $header_width, $ll[1] + $header_height - 2);
+   $pdf->line($ll[0] - 2 + $header_width, $ll[1] + $header_height - 2, $ll[0] - 2 + $header_width, $ll[1] + 2);
+   $pdf->line($ll[0] - 2 + $header_width, $ll[1] + 2, $ll[0] + 2, $ll[1] + 2);
+   
+   $pdf->line($ll[0] + 2, $ll[1] + 110 , $ll[0] - 2 + $header_width, $ll[1] + 110);
+   $pdf->line($ll[0] + 2, $ll[1] + 40 , $ll[0] - 2 + $header_width, $ll[1] + 40);
+   
+   
+   //special image on the map-page
+   if ($special == true){
+   	$pdf->addPngFromFile($specialImage, $specialImage_left, $specialImage_bottom , $specialImage_width, $specialImage_height);
+   }
+   
+   $pdf->setColor(0,0,0);
+   $mySize = 9;
+   $length = $pdf->getTextWidth($mySize, $text1);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,185,$mySize,$text1);
+   
+   $mySize = 8;
+   $length = $pdf->getTextWidth($mySize, $text2);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,175,$mySize,$text2);
+   $length = $pdf->getTextWidth($mySize, $text3);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,165,$mySize,$text3);
+   $mySize = 9;
+   $length = $pdf->getTextWidth($mySize, $text4);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,155,$mySize,$text4);
+   $mySize = 8;
+   $length = $pdf->getTextWidth($mySize, $text5);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,145,$mySize,$text5);   
+   
+   $mySize = 9;
+   $length = $pdf->getTextWidth($mySize, $text6);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,125,$mySize,$text6);
+   $length = $pdf->getTextWidth($mySize, $text7);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,115,$mySize,$text7);
+   $length = $pdf->getTextWidth($mySize, $text8);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,95,$mySize,$text8);
+   $length = $pdf->getTextWidth($mySize, $text9);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,85,$mySize,$text9);
+   $length = $pdf->getTextWidth($mySize, $text10);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,75,$mySize,$text10);
+   
+   $mySize = 8;
+   $length = $pdf->getTextWidth($mySize, $text11);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,60,$mySize,$text11); 
+   $mySize = 6;
+   $length = $pdf->getTextWidth($mySize, $text14);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,53,$mySize,$text14);
+   $length = $pdf->getTextWidth($mySize, $text15);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,47,$mySize,$text15);
+   $length = $pdf->getTextWidth($mySize, $text16);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,41,$mySize,$text16);
+   $length = $pdf->getTextWidth($mySize, $text17);   
+   $pdf->addText($ll[0] + $header_width/2 - $length/2,35,$mySize,$text17);                             
+}
+#Coordinates
+$myMinx = "R ".substr(round($coord[0]), 0, 4)." ".substr(round($coord[0]), 4, 3)."";
+$myMiny = "H ".substr(round($coord[1]), 0, 4)." ".substr(round($coord[1]), 4, 3)."";
+$myMaxx = "R ".substr(round($coord[2]), 0, 4)." ".substr(round($coord[2]), 4, 3)."";
+$myMaxy = "H ".substr(round($coord[3]), 0, 4)." ".substr(round($coord[3]), 4, 3)."";
+
+$mySize = 9;
+$pdf->addText($mapOffset_left - 3, $mapOffset_bottom, $mySize, $myMinx, -90);
+$pdf->addText($mapOffset_left, $mapOffset_bottom  - ($pdf->getFontHeight($mySize)), $mySize, $myMiny);
+$pdf->addText($mapOffset_left  + $map_width - ($pdf->getTextWidth($mySize, $myMaxx)), $mapOffset_bottom + $map_height  + 3, $mySize, $myMaxx);
+$pdf->addText($mapOffset_left + $map_width + 3, $mapOffset_bottom + $map_height, $mySize, $myMaxy, 90);
+
+if ($overview==true){
+	// analyse request, draw rectancle
+	
+	if($size == "A4" && $format == "portrait"){
+		$i = new weldOverview2PNG($overview_url,$array_urls[0] ,$filename);
+
+		$pdf->addPngFromFile($filename, $overview_left,$overview_bottom, $overview_width, $overview_height);
+		if($unlink == true){
+			unlink($filename);
+		}
+	}
+	else{
+		$i = new weldOverview2PNG($overview_url,$array_urls[0],$filename);
+
+		//$pdf->addPngFromFile($filename, $mapOffset_left,$mapOffset_bottom, $overview_width, $overview_height);
+		$pdf->addPngFromFile($filename, $overview_left,$overview_bottom, $overview_width, $overview_height);
+		if($unlink == true){
+			unlink($filename);
+		}
+	}
+}
+
+if ($northarrow==true){
+	$pdf->addPngFromFile($northarrowImage, $northarrow_left, $northarrow_bottom , $northarrowImage_width, $northarrowImage_height);
+}
+
+if($scalebar == true){
+	if ($size == "A4" && $format == "portrait"){
+		$scalebar_left = $a4p_scalebar_left;
+		$scalebar_bottom = $a4p_scalebar_bottom;
+	}elseif ($size == "A4" && $format == "landscape"){
+		$scalebar_left = $a4l_scalebar_left;
+		$scalebar_bottom = $a4l_scalebar_bottom;
+	}elseif ($size == "A3" && $format == "portrait"){
+		$scalebar_left = $a3p_scalebar_left;
+		$scalebar_bottom = $a3p_scalebar_bottom;
+	}elseif ($size == "A3" && $format == "landscape"){
+		$scalebar_left = $a3l_scalebar_left;
+		$scalebar_bottom = $a3l_scalebar_bottom;
+	}
+	
+	$array_scalebar = setscalebar($map_scale);
+	
+	$scalebar_left = $scalebar_left + $header_width/2 - $array_scalebar[1]/2;
+	$pdf->setLineStyle($scalebar_height, '','', array());
+   	$pdf->setColor(0,0,0);
+	#$pdf->line($scalebar_left, $scalebar_bottom , $scalebar_left - 200 + $array_scalebar[1], $scalebar_bottom);
+	$pdf->filledRectangle($scalebar_left, $scalebar_bottom, $array_scalebar[1],$scalebar_height);
+	
+	$pdf->setColor(1,1,1);
+	$pdf->filledRectangle($scalebar_left + $array_scalebar[1]/4 + 1 , $scalebar_bottom + 1, $array_scalebar[1]/4 - 1 ,$scalebar_height-2);	
+	$pdf->setColor(1,1,1);
+	$pdf->filledRectangle($scalebar_left + 3*($array_scalebar[1]/4) + 1 , $scalebar_bottom + 1, $array_scalebar[1]/4 - 2 ,$scalebar_height-2);	
+		
+		
+	#$pdf->setColor(1,0,1);
+	#$pdf->filledRectangle($scalebar_left  , $scalebar_bottom - 20, 1 * $DPC ,$scalebar_height-2);	
+	
+	
+	# value - Einheiten 
+	$pdf->setColor(0,0,0);	
+   $mySize = 8;
+   $scalebar_height_half = 0.5 * $scalebar_height;  
+    
+	$myText = 0;
+   $length = $pdf->getTextWidth($mySize, $myText);  
+   $pdf->addText($scalebar_left - $length/2 ,$scalebar_bottom + 9 ,$mySize,$myText);
+   
+	$myText = $array_scalebar[2]/2;
+   $length = $pdf->getTextWidth($mySize, $myText);     
+   $pdf->addText($scalebar_left + $array_scalebar[1]/2 - $length/2 ,$scalebar_bottom + 9 ,$mySize,$myText);
+	
+	$myText = $array_scalebar[2];
+   $length = $pdf->getTextWidth($mySize, $myText);  
+   $pdf->addText($scalebar_left + $array_scalebar[1] - $length/2 - $length/4 ,$scalebar_bottom + 9 ,$mySize,$myText);
+ 
+	
+	$pdf->setColor(0,0,0);	
+   $mySize = 8;
+   $scalebar_height_half = 0.5 * $scalebar_height;   
+   $myText = $array_scalebar[0];
+
+   #$pdf->addText($scalebar_left + $scalebar_width + 5,$scalebar_bottom - $scalebar_height_half ,$mySize,$myText);
+  
+
+	#units  
+   $length = $pdf->getTextWidth($mySize, $myText);
+   $pdf->addText($scalebar_left + $array_scalebar[1]/2 - $length/2 ,$scalebar_bottom - 12 ,$mySize,$myText);
+ 
+}
+
+
+/* ------------------------ 
+    new page for legend
+   ------------------------ */
+if ($legend == true && $_REQUEST["mylegend"]=='true'){
+
+	$pdf->ezNewPage();
+
+	//Pageborder (top, bottom, left, right)
+	
+	if($size == "A4" && $format == "portrait"){
+	  $pdf->ezSetMargins(50,50,80,30);
+	} else {
+	  $pdf->ezSetMargins(60,35,60,60);
+	}
+	
+	//Requests
+	$my_wms_id = explode("___",$_REQUEST["wms_id"]);
+	$my_wms_title = explode("___",$_REQUEST["wms_title"]);
+	$my_layers = explode("___",$_REQUEST["layers"]);
+	$my_legend = explode("___",$_REQUEST["legendurl"]);
+
+	//frames (x1, y1, x2, y2)
+	if($size == "A4" && $format == "portrait"){
+		#line  
+		$pdf->setLineStyle($linewidth, '', '', array());
+		//left
+		$pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border - $footer_height, $mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border + $header_height);
+		//right
+		$pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border + $header_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border + $header_height);
+		//top
+		$pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border + $header_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom - $border - $footer_height);
+		//bottom
+		$pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom -$border - $footer_height, $mapOffset_left - $border, $mapOffset_bottom - $border - $footer_height);
+		
+		if ($legendImage!=''){
+			//image on top of page
+			$pdf->addPngFromFile($legendImage, $mapOffset_left + $map_width + $border - $legendImage_width -6, $mapOffset_bottom + $map_height + $border + $header_height - $legendImage_height - 4 , $legendImage_width, $legendImage_height);
+		}
+		    
+	} else {
+	  $pdf->setLineStyle($linewidth, '', '', array());
+	  //left
+	  $pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border, $mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border);
+	  //right
+	  $pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border , $mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border);
+	  //top
+	   $pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border , $mapOffset_left + $map_width + $border, $mapOffset_bottom - $border);
+	   //bottom
+	   $pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom -$border , $mapOffset_left - $border, $mapOffset_bottom - $border);
+	   
+		if ($legendImage!=''){
+			//image on top of page
+			$pdf->addPngFromFile($legendImage, $mapOffset_left + $map_width + $border - $legendImage_width -6, $mapOffset_bottom + $map_height + $border - $legendImage_height -4 , $legendImage_width, $legendImage_height);
+			//line under legend (only landscape)
+			//$pdf->line($mapOffset_left - $border, $mapOffset_bottom + $map_height + $border  - $legendImage_height - 4 , $mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border - $legendImage_height - 6);
+		}
+	}
+
+
+	//columns
+	if($size == "A4" && $format == "portrait"){
+	  $pdf->ezColumnsStart(array ('num'=>2, 'gap'=>10));
+	} else {
+	  $pdf->ezColumnsStart(array ('num'=>3, 'gap'=>10));
+	}
+
+	//header from printPDF.conf
+	//$pdf->ezText("<b>".$titel."</b>", 13);
+	$pdf->ezText("<b><u>".$legendText."</u></b>", 13);
+
+	
+	//Seitenränder (top, bottom, left, right)
+	if($size == "A4" && $format == "portrait"){
+	  $pdf->ezSetMargins(70,35,80,30);
+	} else {
+	  $pdf->ezSetMargins(100,35,60,60);
+	}
+	
+	//generate the legend---------------------------------------------
+	
+	// gesamthöhe Legende / height of the legend
+	$sum_legend_height = 0;
+
+
+	for($i=0; $i<count($my_wms_id); $i++){
+		if ($my_wms_id[$i] != '0'){  //wms_id not 0
+			$layer = explode(",",$my_layers[$i]);
+			$my_legendurls = explode(",",$my_legend[$i]);
+			
+			$wms_y_position = $pdf->ezText("<b>".$my_wms_title[$i]."</b>", 12, array('spacing'=>1.2));
+			$wms_zeilenhoehe   =  $pdf->getFontHeight(12);
+				 
+			// add this to the height of the legend /addiere dies zur Gesamthöhe Legende
+			$sum_legend_height += $wms_zeilenhoehe;
+			
+			//Layer
+			$l = 0;		#l temporary parameter to count the layer /Hilfvariable zum durchzählen der angezeigten Layer
+			for($j=0; $j<count($my_legendurls); $j++){
+				// url with grouped layers------------------
+				$temp_url = explode('*',$my_legendurls[$j]);
+				$temp_layers = explode('*',$layer[$j]);
+	
+				for ($q=0; $q <count($temp_url);$q++){  
+					if($temp_url[$q] == '1' ){			// Layertitle for the parent of grouped layers	 
+						// add this to the height of the legend /addiere dies zur Gesamthöhe Legende		
+						$layer_y_position = $pdf->ezText($temp_layers[$q], 11, array('spacing'=>1.2));
+						$layer_zeilenhoehe   =  $pdf->getFontHeight(12);
+						$sum_legend_height += $layer_zeilenhoehe;
+						
+					}elseif($temp_url[$q] != '0' ){
+						$funktionsaufruf = new SaveLegend($temp_url[$q],$legendFilename);
+						$imgsize = getimagesize($legendFilename);
+						// add this to the height of the legend /addiere dies zur Gesamthöhe der Legende
+						$sum_legend_height += $imgsize[1];
+	
+						//calculate text + picture / Berechnung Größe Schrift + Bild
+						if($l == 0){
+						       $y_position = $wms_y_position;
+						       $wms_y_position = '';
+						}else{
+							 $y_position = $pdf->ezText("", 1, array('spacing'=>1.2));
+						}
+						$layer_zeilenhoehe = $pdf->getFontHeight(11);
+						$next_position = $y_position - $layer_zeilenhoehe - $imgsize[1];
+						
+						// add this to the height of the legend / addiere dies zur Gesamthöhe Legende
+						$sum_legend_height += $layer_zeilenhoehe;
+							
+						$l = $l+1;
+		
+		     			// if text + picture are smaler then the lower margin + textsize, then set a space
+						//wenn Schrift + Bild kleiner der unteren Margin + Zeilenhöhe, dann Abstand setzen
+						 if($size == "A4" && $format == "portrait" && $next_position <= 35 +$layer_zeilenhoehe){ //90 $layer_zeilenhoehe
+							$space = $layer_zeilenhoehe + $imgsize[1];
+						  $pdf->ezSetDy(-$space);
+						} 
+						if($size == "A4" && $format == "landscape" && $next_position <= 35+$layer_zeilenhoehe){//50
+							$space = $layer_zeilenhoehe + $imgsize[1];
+						  $pdf->ezSetDy(-$space);
+						}
+				
+						//write the header layername / Überschrift schreiben
+						$legend = $temp_layers[$q]."\n";  //$layer[$j]."\n"; 
+						$pdf->ezText($legend, 11, array('spacing'=>1.2));
+						
+						//$pdf->ezText($url, 9, array('spacing'=>1.2));
+						//print the picture / Bild schreiben
+						$pdf->ezImage($legendFilename, 0, 'width', 'none', 'left');
+						unlink($legendFilename);
+						
+					} //if legendurl
+				}// for legendurl
+	
+			  	//frames (x1, y1, x2, y2)
+				if($size == "A4" && $format == "portrait"){
+					#line  
+					$pdf->setLineStyle($linewidth, '', '', array());
+					//left
+					$pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border - $footer_height, $mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border + $header_height);
+					//right
+					$pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border + $header_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border + $header_height);
+					//top
+					$pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border + $header_height, $mapOffset_left + $map_width + $border, $mapOffset_bottom - $border - $footer_height);
+					//bottom
+					$pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom -$border - $footer_height, $mapOffset_left - $border, $mapOffset_bottom - $border - $footer_height);    
+				} else {
+				  $pdf->setLineStyle($linewidth, '', '', array());
+				  //left
+				  $pdf->line($mapOffset_left - $border, $mapOffset_bottom - $border, $mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border);
+				  //right
+				  $pdf->line($mapOffset_left - $border, $mapOffset_bottom  + $map_height + $border , $mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border);
+				  //top
+				  $pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom + $map_height + $border , $mapOffset_left + $map_width + $border, $mapOffset_bottom - $border);
+				   //bottom
+				   $pdf->line($mapOffset_left + $map_width + $border, $mapOffset_bottom -$border , $mapOffset_left - $border, $mapOffset_bottom - $border);
+				}
+			}// for layers
+		} //if wms_id not 0
+	}// for wms
+
+
+$pdf->ezText($legendFooter, 11);
+}//legend true
+/* ------------------------ 
+    end of legend  
+   ------------------------ */
+
+ob_clean();
+if($download == false){
+	$pdf->ezStream();
+}
+else{
+	$content = $pdf->ezOutput();
+
+	$fp = fopen($downloadFile,'w');
+	fwrite($fp,$content);
+	fclose($fp);
+	echo "<html><head></head><body><a href='".$downloadFile."'>".$downloadText."</a></body></html>";
+}
+?>

Added: trunk/mapbender/http/print/printPDF.conf
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/print/printPDF.conf?view=auto&rev=41
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/print/printPDF.conf	2006-04-13 20:50:52+0000
@@ -0,0 +1,233 @@
+<?php
+include_once("../../conf/mapbender.conf");
+# filename for temporary imagefiles
+$filename = TMPDIR."/map_".substr(md5(uniqid(rand())),0,7).".png";
+
+/*
+* DOWNLOAD
+*/
+$download = false;
+$downloadFile = TMPDIR."/map_".substr(md5(uniqid(rand())),0,7).".pdf";
+$downloadText = "Download: Karte als PDF...";
+
+/*
+*run print as iframe or window
+*/
+$type = 'iframe';
+
+
+
+/*
+* Legend
+*/
+$legend=true;
+$label_legend = 'print legend';
+$legendFilename = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
+$legendText = "Legende";
+$legendFooter = "powerded by Mapbender";
+$legendImage = "./img/mapbender_logo.png";
+$legendImage_width = 90;
+$legendImage_height = 13;
+
+
+# log requests, class 'class_log.php' required
+$log = false;
+
+# delete images:
+$unlink = true;
+
+# labeling
+$text1 = "Druckansicht";
+$text2 = "- Mapbender2 -";
+$text3 = "";
+$text4 = "Maßstab 1 : " . $_REQUEST["map_scale"];
+$text5 = "Datum: " . date("d.m.Y",strtotime("now"));;
+
+$text6 = "Notizen:";
+$text7 = "";
+$text8 = $_REQUEST["comment1"];
+$text9 = $_REQUEST["comment2"];
+$text10 = "";
+
+$text11 = "Der Auszug ist maschinell erzeugt, er ist ohne Unterschrift gültig.";
+$text12 = "Dieser Auszug ist gesetzlich geschützt (§ 3 Abs. 1 VermKatG NW). Vervielfältigungen, Umarbeitungen, Veröffentlichungen oder die Weitergabe an Dritte nur mit Zustimmung des";
+$text13 = "Herausgebers, ausgenommen Vervielfältigungen und Umarbeitungen zur innerdienstlichen Verwendung bei Behörden oder zum eigenen Gebrauch.";
+
+$text14 = "Dieser Auszug ist gesetzlich geschützt (§ 3 Abs. 1 VermKatG NW). Vervielfältigungen,";
+$text15 = "Umarbeitungen, Veröffentlichungen oder die Weitergabe an Dritte nur mit Zustimmung";
+$text16 = "des Herausgebers, ausgenommen Vervielfältigungen und Umarbeitungen zur inner-";
+$text17 = "dienstlichen Verwendung bei Behörden oder zum eigenen Gebrauch.";
+
+/*
+* Labeling for buttons, textfields ...
+*/
+
+$label_format = "Format:";
+$label_format_a4 = "A4";
+$label_format_a3 = "A3";
+
+$label_orientation = "Orientation: ";
+$label_portrait = "portrait";
+$label_landscape = "landscape";
+
+$label_72dpi = "Quality: 72 dpi";
+$label_288dpi = "Quality: 288 dpi";
+
+$label_comment = "Comment (max. 30)";
+$comment_length = 30;
+
+$label_button = 'print';
+
+/*
+* default
+* url string matching and replacement
+*/
+$matching = false;
+$pattern =  "192.168.2.113";
+$replacement = "192.168.2.5";
+
+/*
+* high quality printing 288dpi
+* highquality mapfiles will be supplemented with "_4"
+* example: germany.map -> germany_4.map
+*/
+
+$highquality = false;
+$highqualitymapfiles = array(
+	"/data/umn/germany/germany.map",
+	"/data/umn/germany/germany_demo.map"
+);
+
+# Dots per cm (72 dpi):
+# 28.346456692913385826771653543307 
+$DPC = 28.35;
+
+# available formats:
+$a4 = true;
+$a3 = true;
+
+
+# dimensions of the map:
+
+# A4 portrait
+$a4p_mapOffset_left = 3.3 * $DPC;
+$a4p_mapOffset_bottom = 3 * $DPC;
+$a4p_map_width = 15.7 * $DPC; 
+$a4p_map_height = 22 * $DPC; 
+$a4p_page_width = 21 * $DPC;
+$a4p_page_height = 29.7 * $DPC;
+$a4p_header_height = 2.6 * $DPC;
+$a4p_footer_height = 1.12 * $DPC;
+        
+# A4 landscape
+$a4l_mapOffset_left = 2.3 * $DPC;
+$a4l_mapOffset_bottom = 1.8 * $DPC;
+$a4l_map_width = 25.2 * $DPC;
+$a4l_map_height = 16.4 * $DPC; 
+$a4l_page_width = 29.7 * $DPC;
+$a4l_page_height = 21 * $DPC;   
+$a4l_header_width = 8.5 * $DPC;
+$a4l_header_height = 6 * $DPC;
+        
+# A3 protrait
+$a3p_mapOffset_left = 3.3 * $DPC;
+$a3p_mapOffset_bottom = 3 * $DPC;
+$a3p_map_width = 24.1 * $DPC;
+$a3p_map_height = 36.7 * $DPC;
+$a3p_page_width = 29.7 * $DPC;
+$a3p_page_height = 42 * $DPC;
+$a3p_header_width =  8.5 * $DPC;
+$a3p_header_height = 6 * $DPC;
+
+# A3 landscape        
+$a3l_mapOffset_left = 2.3 * $DPC;
+$a3l_mapOffset_bottom = 1.8 * $DPC;
+$a3l_map_width = 37.4 * $DPC;
+$a3l_map_height = 25.4 * $DPC; 
+$a3l_page_width = 42 * $DPC;
+$a3l_page_height = 29.7 * $DPC;
+$a3l_header_width =  8.5 * $DPC;
+$a3l_header_height = 6 * $DPC;
+
+
+/*
+* Overview
+*/
+$overview = true;
+$a4p_overviewOffset_left = $a4p_mapOffset_left;
+$a4p_overviewOffset_bottom = $a4p_mapOffset_bottom;
+
+$a4l_overviewOffset_left = $a4l_mapOffset_left;
+$a4l_overviewOffset_bottom = $a4l_mapOffset_bottom;
+
+$a3p_overviewOffset_left = $a3p_mapOffset_left;
+$a3p_overviewOffset_bottom = $a3p_mapOffset_bottom;
+
+$a3l_overviewOffset_left = $a3l_mapOffset_left;
+$a3l_overviewOffset_bottom = $a3l_mapOffset_bottom;
+
+/*
+* Northarrow
+*/
+$northarrow = true;
+$northarrowImage = "./img/northarrow.png";
+
+$a4p_northarrow_left = $a4p_mapOffset_left + 160;
+$a4p_northarrow_bottom = $a4p_mapOffset_bottom +2 ;
+
+$a4l_northarrow_left = $a4l_mapOffset_left + 5;
+$a4l_northarrow_bottom = $a4l_mapOffset_bottom + $a4l_map_height - 40;
+
+$a3p_northarrow_left = $a3p_mapOffset_left +5;
+$a3p_northarrow_bottom = $a3p_mapOffset_bottom + $a3p_map_height - 80;
+
+$a3l_northarrow_left = $a3l_mapOffset_left + 5;
+$a3l_northarrow_bottom = $a3l_mapOffset_bottom + $a3l_map_height - 40;
+
+$northarrowImage_width = 15; 
+$northarrowImage_height = 35; 
+
+/*
+* special image for the map-page
+*/
+$special = true;
+$specialImage = "./img/mapbender_logo.png";
+$a4p_special_left = $a4p_mapOffset_left + $a4p_map_width/2 + 100;
+$a4p_special_bottom = $a4p_mapOffset_bottom + $a4p_map_height + 65; 
+
+$a4l_special_left = $a4l_mapOffset_left + $a4l_map_width - $a4l_header_width + 0.8 * $DPC + 10 ;
+$a4l_special_bottom = $a4l_mapOffset_bottom + 54; 
+
+$a3p_special_left = $a3p_mapOffset_left + $a3p_map_width - $a3p_header_width ;
+$a3p_special_bottom = $a3p_mapOffset_bottom + 30; 
+
+$a3l_special_left = $a3l_mapOffset_left + $a3l_map_width - $a3l_header_width + 0.8 * $DPC + 10;
+$a3l_special_bottom = $a3l_mapOffset_bottom + 60; 
+
+$specialImage_width = 90; 
+$specialImage_height = 13; 
+
+
+/*
+* dynamic scalebar
+*/
+$scalebar = true;
+$units = "Meter";
+
+$a4p_scalebar_left = $a4p_mapOffset_left + 2 * $a4p_map_width/3;
+$a4p_scalebar_bottom = $a4p_mapOffset_bottom  + 0.5 * $DPC;
+
+$a4l_scalebar_left = $a4l_mapOffset_left + $a4l_map_width/4 ;
+$a4l_scalebar_bottom = $a4l_mapOffset_bottom +  + 0.5 * $DPC;
+
+$a3p_scalebar_left = $a3p_mapOffset_left  + $a3p_map_width/4 ;
+$a3p_scalebar_bottom = $a3p_mapOffset_bottom + 0.5 * $DPC;
+
+$a3l_scalebar_left = $a3l_mapOffset_left  + $a3l_map_width/4 ;
+$a3l_scalebar_bottom = $a3l_mapOffset_bottom +  + 0.5 * $DPC;
+
+$scalebar_width = 3 * $DPC;
+$scalebar_height = 0.18 * $DPC;
+ 
+
+?>
\ No newline at end of file

Added: trunk/mapbender/http/print/printPDF_b.conf
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/print/printPDF_b.conf?view=auto&rev=41
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/print/printPDF_b.conf	2006-04-13 20:50:52+0000
@@ -0,0 +1,236 @@
+<?php
+
+include_once("../../conf/mapbender.conf");
+# filename for temporary imagefiles
+$filename = TMPDIR."/map_".substr(md5(uniqid(rand())),0,7).".png";
+
+
+/*
+* DOWNLOAD
+*/
+$download = true;
+$downloadFile = TMPDIR."/map_".substr(md5(uniqid(rand())),0,7).".pdf";
+$downloadText = "Download: Karte als PDF...";
+
+/*
+* run print as iframe or window
+*/
+$type = 'window';
+
+
+
+/*
+* Legend
+*/
+$legend=true;
+$label_legend = 'print legend';
+$legendFilename = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
+$legendText = "Legende";
+$legendFooter = "powered by Mapbender";
+$legendImage = "./img/mapbender_logo.png";
+$legendImage_width = 90;
+$legendImage_height = 13;
+
+
+
+# log requests, class 'class_log.php' required
+$log = false;
+
+# delete images:
+$unlink = true;
+
+# labeling
+$text1 = "Druckansicht";
+$text2 = "- Mapbender2 -";
+$text3 = "";
+$text4 = "Maßstab 1 : " . $_REQUEST["map_scale"];
+$text5 = "Datum: " . date("d.m.Y",strtotime("now"));;
+
+$text6 = "Notizen:";
+$text7 = "";
+$text8 = $_REQUEST["comment1"];
+$text9 = $_REQUEST["comment2"];
+$text10 = "";
+
+$text11 = "Der Auszug ist maschinell erzeugt, er ist ohne Unterschrift gültig.";
+$text12 = "Dieser Auszug ist gesetzlich geschützt (§ 3 Abs. 1 VermKatG NW). Vervielfältigungen, Umarbeitungen, Veröffentlichungen oder die Weitergabe an Dritte nur mit Zustimmung des";
+$text13 = "Herausgebers, ausgenommen Vervielfältigungen und Umarbeitungen zur innerdienstlichen Verwendung bei Behörden oder zum eigenen Gebrauch.";
+
+$text14 = "Dieser Auszug ist gesetzlich geschützt (§ 3 Abs. 1 VermKatG NW). Vervielfältigungen,";
+$text15 = "Umarbeitungen, Veröffentlichungen oder die Weitergabe an Dritte nur mit Zustimmung";
+$text16 = "des Herausgebers, ausgenommen Vervielfältigungen und Umarbeitungen zur inner-";
+$text17 = "dienstlichen Verwendung bei Behörden oder zum eigenen Gebrauch.";
+
+/*
+* Labeling for buttons, textfields ...
+*/
+
+$label_format = "Format:";
+$label_format_a4 = "A4";
+$label_format_a3 = "A3";
+
+$label_orientation = "Orientation: ";
+$label_portrait = "portrait";
+$label_landscape = "landscape";
+
+$label_72dpi = "Quality: 72 dpi";
+$label_288dpi = "Quality: 288 dpi";
+
+$label_comment = "Comment (max. 30)";
+$comment_length = 30;
+
+$label_button = 'print';
+
+
+
+/*
+* default
+* url string matching and replacement
+*/
+$matching = false;
+$pattern =  "192.168.2.113";
+$replacement = "192.168.2.5";
+
+/*
+* high quality printing 288dpi
+* highquality mapfiles will be supplemented with "_4"
+* example: germany.map -> germany_4.map
+*/
+
+$highquality = false;
+$highqualitymapfiles = array(
+	"/data/umn/germany/germany.map",
+	"/data/umn/germany/germany_demo.map"
+);
+
+# Dots per cm (72 dpi):
+# 28.346456692913385826771653543307 
+$DPC = 28.35;
+
+# available formats:
+$a4 = true;
+$a3 = true;
+
+
+# dimensions of the map:
+
+# A4 portrait
+$a4p_mapOffset_left = 3.3 * $DPC;
+$a4p_mapOffset_bottom = 3 * $DPC;
+$a4p_map_width = 15.7 * $DPC; 
+$a4p_map_height = 22 * $DPC; 
+$a4p_page_width = 21 * $DPC;
+$a4p_page_height = 29.7 * $DPC;
+$a4p_header_height = 2.6 * $DPC;
+$a4p_footer_height = 1.12 * $DPC;
+        
+# A4 landscape
+$a4l_mapOffset_left = 2.3 * $DPC;
+$a4l_mapOffset_bottom = 1.8 * $DPC;
+$a4l_map_width = 25.2 * $DPC;
+$a4l_map_height = 16.4 * $DPC; 
+$a4l_page_width = 29.7 * $DPC;
+$a4l_page_height = 21 * $DPC;   
+$a4l_header_width = 8.5 * $DPC;
+$a4l_header_height = 6 * $DPC;
+        
+# A3 portrait
+$a3p_mapOffset_left = 3.3 * $DPC;
+$a3p_mapOffset_bottom = 3 * $DPC;
+$a3p_map_width = 24.1 * $DPC;
+$a3p_map_height = 36.7 * $DPC;
+$a3p_page_width = 29.7 * $DPC;
+$a3p_page_height = 42 * $DPC;
+$a3p_header_width =  8.5 * $DPC;
+$a3p_header_height = 6 * $DPC;
+
+# A3 landscape        
+$a3l_mapOffset_left = 2.3 * $DPC;
+$a3l_mapOffset_bottom = 1.8 * $DPC;
+$a3l_map_width = 37.4 * $DPC;
+$a3l_map_height = 25.4 * $DPC; 
+$a3l_page_width = 42 * $DPC;
+$a3l_page_height = 29.7 * $DPC;
+$a3l_header_width =  8.5 * $DPC;
+$a3l_header_height = 6 * $DPC;
+
+/*
+* Overview
+*/
+$overview = true;
+$a4p_overviewOffset_left = $a4p_mapOffset_left;
+$a4p_overviewOffset_bottom = $a4p_mapOffset_bottom;
+
+$a4l_overviewOffset_left = $a4l_mapOffset_left;
+$a4l_overviewOffset_bottom = $a4l_mapOffset_bottom;
+
+$a3p_overviewOffset_left = $a3p_mapOffset_left;
+$a3p_overviewOffset_bottom = $a3p_mapOffset_bottom;
+
+$a3l_overviewOffset_left = $a3l_mapOffset_left;
+$a3l_overviewOffset_bottom = $a3l_mapOffset_bottom;
+
+/*
+* Northarrow
+*/
+$northarrow = true;
+$northarrowImage = "./img/northarrow.png";
+
+$a4p_northarrow_left = $a4p_mapOffset_left + 160;
+$a4p_northarrow_bottom = $a4p_mapOffset_bottom +2 ;
+
+$a4l_northarrow_left = $a4l_mapOffset_left + 5;
+$a4l_northarrow_bottom = $a4l_mapOffset_bottom + $a4l_map_height - 40;
+
+$a3p_northarrow_left = $a3p_mapOffset_left +5;
+$a3p_northarrow_bottom = $a3p_mapOffset_bottom + $a3p_map_height - 80;
+
+$a3l_northarrow_left = $a3l_mapOffset_left + 5;
+$a3l_northarrow_bottom = $a3l_mapOffset_bottom + $a3l_map_height - 40;
+
+$northarrowImage_width = 15; 
+$northarrowImage_height = 35; 
+
+/*
+* special image for the map-page
+*/
+$special = true;
+$specialImage = "./img/mapbender_logo.png";
+$a4p_special_left = $a4p_mapOffset_left + $a4p_map_width/2 + 100;
+$a4p_special_bottom = $a4p_mapOffset_bottom + $a4p_map_height + 65; 
+
+$a4l_special_left = $a4l_mapOffset_left + $a4l_map_width - $a4l_header_width + 0.8 * $DPC + 10 ;
+$a4l_special_bottom = $a4l_mapOffset_bottom + 54; 
+
+$a3p_special_left = $a3p_mapOffset_left + $a3p_map_width - $a3p_header_width ;
+$a3p_special_bottom = $a3p_mapOffset_bottom + 30; 
+
+$a3l_special_left = $a3l_mapOffset_left + $a3l_map_width - $a3l_header_width + 0.8 * $DPC + 10;
+$a3l_special_bottom = $a3l_mapOffset_bottom + 60; 
+
+$specialImage_width = 90; 
+$specialImage_height = 13;
+
+
+/*
+* dynamic scalebar
+*/
+$scalebar = true;
+$units = "Meter";
+
+$a4p_scalebar_left = $a4p_mapOffset_left + 2 * $a4p_map_width/3;
+$a4p_scalebar_bottom = $a4p_mapOffset_bottom  + 0.5 * $DPC;
+
+$a4l_scalebar_left = $a4l_mapOffset_left + $a4l_map_width/4 ;
+$a4l_scalebar_bottom = $a4l_mapOffset_bottom +  + 0.5 * $DPC;
+
+$a3p_scalebar_left = $a3p_mapOffset_left  + $a3p_map_width/4 ;
+$a3p_scalebar_bottom = $a3p_mapOffset_bottom + 0.5 * $DPC;
+
+$a3l_scalebar_left = $a3l_mapOffset_left  + $a3l_map_width/4 ;
+$a3l_scalebar_bottom = $a3l_mapOffset_bottom +  + 0.5 * $DPC;
+
+$scalebar_width = 3 * $DPC;
+$scalebar_height = 0.18 * $DPC;
+ 
+?>
\ No newline at end of file




More information about the Mapbender_commits mailing list