getElementsByTagName('input')->item(0); $extent = split(' ',$inputObj->getAttribute('mapext')); $canvasObj = $xml->getElementsByTagName('canvas')->item(0); # Get ye ole page size $pageSize = split(' ', $inputObj->getAttribute('pagesize')); $pageWidth = $pageSize[0]; $pageHeight = $pageSize[1]; # Get the options for north arrow, legends, and scalebar $legends = ($inputObj->hasAttribute('legend') and $inputObj->getAttribute('legend') == 'yes'); $northArrow = ($inputObj->hasAttribute('north') and $inputObj->getAttribute('north') == 'yes'); $scalebar = ($inputObj->hasAttribute('scalebar') and $inputObj->getAttribute('scalebar') == 'yes'); $keepscale = ($inputObj->hasAttribute('keepscale') and $inputObj->getAttribute('keepscale') == 'yes'); $title = 'GeoMOOSE Map'; for($i = 0; $i < $canvasObj->childNodes->length && !$mapTitle; $i++) { $child = $canvasObj->childNodes->item($i); if($child->tagName == 'param') { if($child->getAttribute('name') == 'title') { $title = $child->getAttribute('value'); } } } $quality = ($inputObj->hasAttribute('quality') ? $inputObj->getAttribute('quality') : 2); //Determine Map Size $mapheight=9; $mapwidth = 7.6; $legheight=0; $legstart=$mapheight+.85; if($showParcel) { $mapheight=7.5; $legheight=1.3; $legstart=$mapheight+.85; } //Start fpdf to place all of the components class PDF extends FPDF { //Page header function Header() { global $title; $this->SetFont('Arial','B',12); $this->Cell(0,.50,$title,0,1,'C'); } //Page footer function Footer() { $this->SetY(-1); $this->SetFont('Arial','I',7); } } //Instanciation of inherited class # $pdf=new PDF('P','in','letter'); $pdf = new PDF('P', 'in', array($pageWidth, $pageHeight)); $pdf->SetDisplayMode('fullpage'); $pdf->SetMargins(.25,.25); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 12); $pdf->Text(.42, .5, $title); #$pdf->SetX(.5); #$pdf->SetY(.5); #$pdf->Cell(0,.50,$title,0,1,'C'); $pdf->SetLineWidth(.1); $pdf->SetDrawColor(0,0,150); $pdf->Rect(.25,.25,$pageWidth - .5, $pageHeight - .5); //add outline around map image if ($legheight > 0) { $pdf->Rect(.40,$legstart,7.7,$legheight+.1); $text2="Parcel Report"; $text3="PIN: " . $pin; $text4="Taxpayer: " . $taxpayer; $text5="GIS Acres: " . $gis_acres; $text6="Notes: " . $web_notes; $pdf->SetFont('Arial','B',12); $pdf->Text(.42,8.55,$text2); $pdf->SetFont('Arial','',10); $pdf->Text(.5,8.75,$text3); $pdf->Text(.5,8.95,$text4); $pdf->Text(.5,9.15,$text5); $pdf->Text(.5,9.35,$text6); } //adds footer text $date=date('M j, Y g:i'); $footerMessages = array(); $footerMessages[0] = "Disclaimer: Douglas County does not warrant or guarantee the accuracy of the data."; $footerMessages[1] = "The data is meant for reference purposes only and should not be used for official decisions."; $footerMessages[2] = "If you have questions regarding the data presented in this map, please contact the Douglas County GIS Department."; $footerMessages[3] ="Map created on $date. This information is to be used for reference purposes only."; $footerMessages[4]= "Copyright © 2006 Douglas County GIS, All Rights Reserved"; $messages = $xml->getElementsByTagName('message'); for($m = 0; $m < $messages->length; $m++) { array_unshift($footerMessages, $messages->item($m)->nodeValue); } $pdf->SetFont('Arial','',8); $footerMessages = array_reverse($footerMessages); for($i = 0; $i < sizeof($footerMessages); $i++) { $pdf->Text(.42, $pageHeight - .25 - (($i+1) * 8/72),$footerMessages[$i]); } # Calculate the height of the footer messages $footerGutterSize = .25 + sizeof($footerMessages) * 8/72; $northArrowHeight = 0; if($northArrow) { $pdf->Image("resources/north.jpg",$pageWidth-1,$pageHeight-1,.6,.6); $northArrowHeight = .6; } $finalFooterHeight = $footerGutterSize; if($finalFooterHeight < $northArrowHeight) { $finalFooterHeight = $northArrowheight; } //output file $pdf->SetTitle('Douglas County MapMorph'); $mapwidth = $pageWidth - .90; $mapheight = $pageHeight - 1 - $finalFooterHeight; $pdf->SetLineWidth(.01); $pdf->SetDrawColor(0,0,200); $pdf->Rect(.40,.65,$mapwidth+.1,$mapheight+.1); renderImage($xml, $outputPdf.'.jpeg', $mapwidth*$quality*72, $mapheight*$quality*72, $extent[0], $extent[1], $extent[2], $extent[3], $quality, $keepscale); $pdf->Image($outputPdf.'.jpeg',.45,.70,$mapwidth,$mapheight); $pdf->Output($outputPdf.'.pdf'); } ?>