} if (!isset($person["SECONDARY_COLOR"]) || $person["SECONDARY_COLOR"] == "") { $person["SECONDARY_COLOR"] = $person["PRIMARY_COLOR"]; } /* present a uniform outline if the roles are the same */ if ($person["PRIMARY_ROLE"] == $person["SECONDARY_ROLE"]) { $rpoints[2] = $right_edge - $base_width * 11; $rpoints[4] = $right_edge - $base_width * 10; $rpoints[10] = $right_edge - 3 * $base_width; $rpoints[12] = $right_edge - 2 * $base_width; } /* don't display the outline if the person has no role */ if ($person["PRIMARY_ROLE"] != "Unknown") { $color = get_color($person["PRIMARY_COLOR"]); $pdf->setcolor($color[0], $color[1], $color[2]); $pdf->polygon($lpoints, 8, 1); $color = get_text_color($person["PRIMARY_COLOR"]); $pdf->setcolor($color[0], $color[1], $color[2]); $role1Width = $pdf->getTextWidth(12, $person["PRIMARY_ROLE"]); $pdf->addText($left_edge + $base_width / 2, $top_edge - 12, 12, $person["PRIMARY_ROLE"]); $color = get_color($person["SECONDARY_COLOR"]); $pdf->setcolor($color[0], $color[1], $color[2]); $pdf->polygon($rpoints, 8, 1); $color = get_text_color($person["SECONDARY_COLOR"]); $pdf->setcolor($color[0], $color[1], $color[2]); $role2Width = $pdf->getTextWidth(12, $person["SECONDARY_ROLE"]); $pdf->addText($right_edge - $base_width / 2 - $role2Width, $bottom_edge + 6, 12, $person["SECONDARY_ROLE"]); $pdf->setcolor(0, 0, 0); } } if ($offsetRow == 0) {
function CREATEPDF($p) { $sGeo = explode("|", $p); $tokens = explode(",", $sGeo[0]); $sMin = explode(" ", $tokens[0]); $sMax = explode(" ", $tokens[2]); $sMinX = $sMin[0]; $sMinY = $sMin[1]; $oPDF = new Cezpdf('a4', 'portrait') or die("Kan PDFLib niet gebruiken"); $oPDF->ezSetMargins(20, 20, 20, 20); $oPDF->openHere('Fit'); $ext1 = $sMax[1] - $sMin[0]; $ext2 = $sMax[2] - $sMin[1]; $oPDF->setLineStyle(2); $oPDF->rectangle(20, 20, 595.28 - 40, 841.89 - 40); for ($iRecord = 1; $iRecord < count($sGeo) - 1; $iRecord++) { $oPDF->setLineStyle(0.1); $oPDF->setColor(1, 0, 0); $oPDF->setStrokeColor(0.5, 0.5, 0.5); $tokens = explode(",", $sGeo[$iRecord]); $point = array(); $waarde = 0; //$waardex = (297.64); //$waardey = (420.945); //$waardex = 0; //$waardey = 0; for ($gRecord = 0; $gRecord < count($tokens); $gRecord++) { $sPunt = explode(" ", $tokens[$gRecord]); if ($gRecord == 0) { $sX = $sPunt[0] - $sMinX; $sY = $sPunt[1] - $sMinY; $point[$waarde] = $sX * 1000 / 0.3528 / 350000; $point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000; } elseif ($gRecord == count($tokens) - 1) { $sX = $sPunt[1] - $sMinX; $sY = $sPunt[2] - $sMinY; $point[$waarde] = $sX * 1000 / 0.3528 / 350000; $point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000; } else { $sX = $sPunt[1] - $sMinX; $sY = $sPunt[2] - $sMinY; $point[$waarde] = $sX * 1000 / 0.3528 / 350000; $point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000; } $waarde = $waarde + 2; } $oPDF->polygon($point, $waarde / 2, 1); $oPDF->polygon($point, $waarde / 2); unset($point); } $oPDF->ezStream(); }