public static function result_file_to_pdf(&$result_file, $dest, $output_name, $extra_attributes = null) { ob_start(); $_REQUEST['force_format'] = 'JPEG'; // Force to PNG renderer $_REQUEST['svg_dom_gd_no_interlacing'] = true; // Otherwise FPDF will fail $pdf = new pts_pdf_template($result_file->get_title(), null); $pdf->AddPage(); $pdf->Image(PTS_CORE_STATIC_PATH . 'images/pts-308x160.png', 69, 85, 73, 38); $pdf->Ln(120); $pdf->WriteStatementCenter('www.phoronix-test-suite.com'); $pdf->Ln(15); $pdf->WriteBigHeaderCenter($result_file->get_title()); $pdf->WriteText($result_file->get_description()); $pdf->AddPage(); $pdf->Ln(15); $pdf->SetSubject($result_file->get_title() . ' Benchmarks'); //$pdf->SetKeywords(implode(', ', $identifiers)); $pdf->WriteHeader('Test Systems:'); foreach ($result_file->get_systems() as $s) { $pdf->WriteMiniHeader($s->get_identifier()); $pdf->WriteText($s->get_hardware()); $pdf->WriteText($s->get_software()); } $pdf->AddPage(); $placement = 1; $i = 0; foreach ($result_file->get_result_objects() as $key => &$result_object) { $graph = pts_render::render_graph_process($result_object, $result_file, false, $extra_attributes); if ($graph == false) { continue; } $graph->renderGraph(); $output = $graph->svg_dom->output(null); $pdf->Ln(100); $pdf->ImageJPGInline($output, 50, 40 + ($placement - 1) * 120, 120); if ($placement == 2) { $placement = 0; if ($i != count($results)) { $pdf->AddPage(); } } $placement++; $i++; } ob_get_clean(); $pdf->Output($dest, $output_name); }