$o = new Person($g_indiv); # initialize other variables $sources = array(); $font = 'helvetica'; $g_node_indkey = array(); $g_node_strings = array(); $g_node_parents = array(); $g_content_height = 625; # instantiate new tree $tree = new ATree($g_indiv); # fill tree with ancestors $tree->fill_tree(4); # get root node and traverse tree # each node of the tree is passed to the display_indiv function $root = $tree->get_node_at_index(0); $tree->level_order_traversal($root, 'process_indiv'); /** * Extend FPDF class to add header and footer * @package theme_default * @access public */ class PDF extends FPDF { # Page header function Header() { global $o, $font; $this->SetFont($font, 'BU', 12); $this->Cell(0, 5, sprintf(gtc("Pedigree for %s"), $o->full_name()), 0, 0, 'C'); $this->Ln(15); }
$this->Cell(0, 4, sprintf(gtc("Send questions or comments to %s"), '*****@*****.**'), 0, 0, 'C', 0, 'mailto:keithm@infused.org'); } } # Begin PDF Output $pdf = new PDF('P', 'mm', 'Letter'); $pdf->Open(); $pdf->SetTopMargin(13); $pdf->SetLeftMargin(13); $pdf->SetRightMargin(10); $pdf->SetAutoPageBreak(True, 13); $pdf->AddPage(); $pdf->SetCreator($_SERVER['PHP_SELF']); $pdf->SetAuthor('Keith Morrison, keithm@infused.org'); $pdf->SetTitle(sprintf(gtc("Ahnentafel Report for %s"), $o->full_name())); $pdf->SetSubject(gtc("Genealogy")); $tree->level_order_traversal($root, 'display_indiv'); function display_indiv($p_node, $p_generation) { global $pdf, $g_generation, $font; $gencol = 13; $factcol = 30; $father = null; $mother = null; if ($p_node->father_indkey) { $father = new Person($p_node->father_indkey, 1); } if ($p_node->mother_indkey) { $mother = new Person($p_node->mother_indkey, 1); } if ($p_generation > $g_generation) { $g_generation = $p_generation;