How to use Header method of pts_pdf_template class

Best Phoronix-test-suite code snippet using pts_pdf_template.Header

dump_documentation.php

Source:dump_documentation.php Github

copy

Full Screen

...25 $pdf->Image(PTS_CORE_STATIC_PATH . 'images/pts-308x160.png', 69, 85, 73, 38, 'PNG', 'http://www.phoronix-test-suite.com/');26 $pdf->Ln(120);27 $pdf->WriteStatement('www.phoronix-test-suite.com', 'C', 'http://www.phoronix-test-suite.com/');28 $pdf->Ln(15);29 $pdf->WriteBigHeaderCenter(pts_core::program_title(true));30 $pdf->WriteHeaderCenter('User Manual');31 //$pdf->WriteText($result_file->get_description());32 $pts_options = pts_documentation::client_commands_array();33 // Write the test options HTML34 $dom = new DOMDocument();35 $html = $dom->createElement('html');36 $dom->appendChild($html);37 $head = $dom->createElement('head');38 $title = $dom->createElement('title', 'User Options');39 $head->appendChild($title);40 $html->appendChild($head);41 $body = $dom->createElement('body');42 $html->appendChild($body);43 $p = $dom->createElement('p', 'The following options are currently supported by the Phoronix Test Suite client. A list of available options can also be found by running ');44 $em = $dom->createElement('em', 'phoronix-test-suite help.');45 $p->appendChild($em);46 $phr = $dom->createElement('hr');47 $p->appendChild($phr);48 $body->appendChild($p);49 foreach($pts_options as $section => &$contents)50 {51 if(empty($contents))52 {53 continue;54 }55 $header = $dom->createElement('h1', $section);56 $body->appendChild($header);57 sort($contents);58 foreach($contents as &$option)59 {60 $sub_header = $dom->createElement('h3', $option[0]);61 $em = $dom->CreateElement('em', ' ' . implode(' ', $option[1]));62 $sub_header->appendChild($em);63 $body->appendChild($sub_header);64 $p = $dom->createElement('p', $option[2]);65 $body->appendChild($p);66 }67 }68 $dom->saveHTMLFile(PTS_PATH . 'documentation/stubs/00_user_options.html');69 // Write the module options HTML70 $dom = new DOMDocument();71 $html = $dom->createElement('html');72 $dom->appendChild($html);73 $head = $dom->createElement('head');74 $title = $dom->createElement('title', 'Module Options');75 $head->appendChild($title);76 $html->appendChild($head);77 $body = $dom->createElement('body');78 $html->appendChild($body);79 $p = $dom->createElement('p', 'The following list is the modules included with the Phoronix Test Suite that are intended to extend the functionality of pts-core. Some of these options have commands that can be run directly in a similiar manner to the other Phoronix Test Suite user commands. Some modules are just meant to be loaded directly by adding the module name to the LoadModules tag in ~/.phoronix-test-suite/user-config.xml or via the PTS_MODULES environmental variable. A list of available modules is also available by running ');80 $em = $dom->createElement('em', 'phoronix-test-suite list-modules.');81 $p->appendChild($em);82 $phr = $dom->createElement('hr');83 $p->appendChild($phr);84 $body->appendChild($p);85 foreach(pts_module_manager::available_modules(true) as $module)86 {87 pts_module_manager::load_module($module);88 $header = $dom->createElement('h2', pts_module_manager::module_call($module, 'module_name'));89 $body->appendChild($header);90 $desc = $dom->createElement('p', pts_module_manager::module_call($module, 'module_description'));91 $body->appendChild($desc);92 $all_options = pts_module_manager::module_call($module, 'user_commands');93 if(count($all_options) > 0)94 {95 // $sub_header = $dom->createElement('h3', 'Module Commands');96 // $body->appendChild($sub_header);97 foreach($all_options as $key => $option)98 {99 $p = $dom->createElement('p', 'phoronix-test-suite ' . $module . '.' . str_replace('_', '-', $key));100 $body->appendChild($p);101 }102 }103 $vars = pts_module_manager::module_call($module, 'module_environmental_variables');104 if(is_array($vars) && count($vars) > 0)105 {106 $p = $dom->createElement('p', 'This module utilizes the following environmental variables: ' . implode(', ', $vars) . '.');107 $body->appendChild($p);108 }109 }110 $dom->saveHTMLFile(PTS_PATH . 'documentation/stubs/00_zmodule_options.html');111 // Write the external dependencies HTML112 $dom = new DOMDocument();113 $html = $dom->createElement('html');114 $dom->appendChild($html);115 $head = $dom->createElement('head');116 $title = $dom->createElement('title', 'External Dependencies');117 $head->appendChild($title);118 $html->appendChild($head);119 $body = $dom->createElement('body');120 $html->appendChild($body);121 $p = $dom->createElement('p', 'The Phoronix Test Suite has a feature known as "External Dependencies" where the Phoronix Test Suite can attempt to automatically install some of the test-specific dependencies on supported distributions. If running on a distribution where there is currently no External Dependencies profile, the needed package name(s) are listed for manual installation.');122 $body->appendChild($p);123 $p = $dom->createElement('p', 'Below are a list of the operating systems that currently have external dependencies support within the Phoronix Test Suite for the automatic installation of needed test files.');124 $body->appendChild($p);125 $phr = $dom->createElement('hr');126 $p->appendChild($phr);127 $exdep_generic_parser = new pts_exdep_generic_parser();128 $vendors = array_merge($exdep_generic_parser->get_vendor_aliases_formatted(), $exdep_generic_parser->get_vendors_list_formatted());129 sort($vendors);130 $ul = $dom->createElement('ul');131 $p->appendChild($ul);132 foreach($vendors as $vendor)133 {134 $li = $dom->createElement('li', $vendor);135 $p->appendChild($li);136 }137 $dom->saveHTMLFile(PTS_PATH . 'documentation/stubs/02_external_dependencies.html');138 // Write the virtual suites HTML139 $dom = new DOMDocument();140 $html = $dom->createElement('html');141 $dom->appendChild($html);142 $head = $dom->createElement('head');143 $title = $dom->createElement('title', 'Virtual Test Suites');144 $head->appendChild($title);145 $html->appendChild($head);146 $body = $dom->createElement('body');147 $html->appendChild($body);148 $p = $dom->createElement('p', 'Virtual test suites are not like a traditional test suite defined by the XML suite specification. Virtual test suites are dynamically generated in real-time by the Phoronix Test Suite client based upon the specified test critera. Virtual test suites can automatically consist of all test profiles that are compatible with a particular operating system or test profiles that meet other critera. When running a virtual suite, the OpenBenchmarking.org repository of the test profiles to use for generating the dynamic suite must be prefixed. ');149 $body->appendChild($p);150 $p = $dom->createElement('p', 'Virtual test suites can be installed and run just like a normal XML test suite and shares nearly all of the same capabilities. However, when running a virtual suite, the user will be prompted to input any user-configuration options for needed test profiles just as they would need to do if running the test individually. When running a virtual suite, the user also has the ability to select individual tests within the suite to run or to run all of the contained test profiles. Virtual test suites are also only supported for an OpenBenchmarking.org repository if there is no test profile or test suite of the same name in the repository. Below is a list of common virtual test suites for the main Phoronix Test Suite repository, but the dynamic list of available virtual test suites based upon the enabled repositories is available by running ');151 $em = $dom->createElement('em', 'phoronix-test-suite list-available-virtual-suites.');152 $p->appendChild($em);153 $phr = $dom->createElement('hr');154 $p->appendChild($phr);155 $body->appendChild($p);156 foreach(pts_virtual_test_suite::available_virtual_suites() as $virtual_suite)157 {158 $sub_header = $dom->createElement('h3', $virtual_suite->get_title());159 $em = $dom->CreateElement('em', ' ' . $virtual_suite->get_identifier());160 $sub_header->appendChild($em);161 $body->appendChild($sub_header);162 $p = $dom->createElement('p', $virtual_suite->get_description());163 $body->appendChild($p);164 }165 $dom->saveHTMLFile(PTS_PATH . 'documentation/stubs/55_virtual_suites.html');166 // Load the HTML documentation167 foreach(pts_file_io::glob(PTS_PATH . 'documentation/stubs/*_*.html') as $html_file)168 {169 $pdf->html_to_pdf($html_file);170 $html_doc->html_to_html($html_file);171 }172 if(!is_writable(PTS_PATH . 'documentation/'))173 {174 echo PHP_EOL . 'Not writable: ' . PTS_PATH . 'documentation/';175 }176 else177 {178 $pdf_file = PTS_PATH . 'documentation/phoronix-test-suite.pdf';179 $pdf->Output($pdf_file);180 $html_doc->Output(PTS_PATH . 'documentation/phoronix-test-suite.html');181 echo PHP_EOL . 'Saved To: ' . $pdf_file . PHP_EOL . PHP_EOL;182 // Also re-generate the man page183 $man_page = '.TH phoronix-test-suite 1 "www.phoronix-test-suite.com" "' . PTS_VERSION . '"' . PHP_EOL . '.SH NAME' . PHP_EOL;184 $man_page .= 'phoronix-test-suite \- The Phoronix Test Suite is an extensible open-source platform for performing testing and performance evaluation.' . PHP_EOL;185 $man_page .= '.SH SYNOPSIS' . PHP_EOL . '.B phoronix-test-suite [options]' . PHP_EOL . '.br' . PHP_EOL . '.B phoronix-test-suite benchmark [test | suite]' . PHP_EOL;186 $man_page .= '.SH DESCRIPTION' . PHP_EOL . pts_documentation::basic_description() . PHP_EOL;187 $man_page .= '.SH OPTIONS' . PHP_EOL . '.TP' . PHP_EOL;188 foreach($pts_options as $section => &$contents)189 {190 if(empty($contents))191 {192 continue;193 }194 $man_page .= '.SH ' . strtoupper($section) . PHP_EOL;195 sort($contents);196 foreach($contents as &$option)197 {198 $man_page .= '.B ' . trim($option[0] . ' ' . (!empty($option[1]) && is_array($option[1]) ? implode(' ', $option[1]) : null)) . PHP_EOL . $option[2] . PHP_EOL . '.TP' . PHP_EOL;199 }200 }201 $man_page .= '.SH SEE ALSO' . PHP_EOL . '.B Websites:' . PHP_EOL . '.br' . PHP_EOL . 'http://www.phoronix-test-suite.com/' . PHP_EOL . '.br' . PHP_EOL . 'http://commercial.phoronix-test-suite.com/' . PHP_EOL . '.br' . PHP_EOL . 'http://www.openbenchmarking.org/' . PHP_EOL . '.br' . PHP_EOL . 'http://www.phoronix.com/' . PHP_EOL . '.br' . PHP_EOL . 'http://www.phoronix.com/forums/' . PHP_EOL;202 $man_page .= '.SH AUTHORS' . PHP_EOL . 'Copyright 2008 - ' . date('Y') . ' by Phoronix Media, Michael Larabel.' . PHP_EOL . '.TP' . PHP_EOL;203 file_put_contents(PTS_PATH . 'documentation/man-pages/phoronix-test-suite.1', $man_page);204 }205 // simple README206 $readme = '# Phoronix Test Suite ' . PTS_VERSION . PHP_EOL . 'http://www.phoronix-test-suite.com/' . PHP_EOL . PHP_EOL;207 $readme .= pts_documentation::basic_description() . PHP_EOL . PHP_EOL;208 $readme .= pts_file_io::file_get_contents(PTS_PATH . 'documentation/stubs/readme-basics.txt') . PHP_EOL . PHP_EOL;209 $readme = wordwrap($readme, 80, PHP_EOL);210 file_put_contents(PTS_PATH . 'README.md', $readme);211 // Phoromatic Documentation212 $pdf = new pts_pdf_template(pts_core::program_title(false), 'Phoromatic Documentation');213 $html_doc = new pts_html_template(pts_core::program_title(false), 'Phoromatic Documentation');214 $pdf->AddPage();215 $pdf->Image(PTS_CORE_STATIC_PATH . 'images/pts-308x160.png', 69, 85, 73, 38, 'PNG', 'http://www.phoronix-test-suite.com/');216 $pdf->Ln(120);217 $pdf->WriteStatement('www.phoronix-test-suite.com', 'C', 'http://www.phoronix-test-suite.com/');218 $pdf->Ln(15);219 $pdf->Image(PTS_CORE_STATIC_PATH . 'images/phoromatic-390x56.png', 55, 250, 0, 0, 'PNG', 'http://www.phoronix-test-suite.com/');220 //$pdf->Image(PTS_CORE_STATIC_PATH . 'images/phoromatic-390x56.png', 69, 85, 73, 38, 'PNG', 'http://www.phoromatic.com/');221 $pdf->WriteBigHeaderCenter(pts_core::program_title(true));222 $pdf->WriteHeaderCenter('Phoromatic User Manual');223 $pdf->html_to_pdf(PTS_PATH . 'documentation/phoromatic.html');224 $pdf_file = PTS_PATH . 'documentation/phoromatic.pdf';225 $pdf->Output($pdf_file);226 echo PHP_EOL . 'Saved To: ' . $pdf_file . PHP_EOL . PHP_EOL;227 }228}229?>...

Full Screen

Full Screen

Header

Using AI Code Generation

copy

Full Screen

1$pdf->Header('This is a header');2$pdf->Footer('This is a footer');3$pdf->Body('This is a body');4$pdf->Footer('This is a footer');5$pdf->Body('This is a body');6$pdf->Footer('This is a footer');7$pdf->Body('This is a body');8$pdf->Footer('This is a footer');9$pdf->Body('This is a body');10$pdf->Footer('This is a footer');11$pdf->Body('This is a body');12$pdf->Footer('This is a footer');13$pdf->Body('This is a body');14$pdf->Footer('This is a footer');15$pdf->Body('This is a body');16$pdf->Footer('This is a footer');17$pdf->Body('This is a body');18$pdf->Footer('This is a footer');

Full Screen

Full Screen

Header

Using AI Code Generation

copy

Full Screen

1$pts_pdf->Header($pdf, $pts_pdf->header);2$pts_pdf->Footer($pdf, $pts_pdf->footer);3$pts_pdf->Body($pdf, $pts_pdf->body);4$pdf->AddPage();5$pdf->Output();6$pdf->AddPage();7$pts_pdf->Body($pdf, $pts_pdf->body);8$pdf->Output();9I think you are using the wrong function. You should use the function AddPage() instead of the

Full Screen

Full Screen

Header

Using AI Code Generation

copy

Full Screen

1$pdf->Header();2$pdf->Footer();3$pdf->Text();4$pdf->Image();5$pdf->AddPage();6$pdf->SetFont('Arial','B',16);7$pdf->Cell(40,10,'Hello World!');8$pdf->Output();

Full Screen

Full Screen

Header

Using AI Code Generation

copy

Full Screen

1$pdf->Header("Header Text", "Header Sub Text", "Header Image Path", "Header Image Width", "Header Image Height");2$pdf->Footer("Footer Text", "Footer Sub Text", "Footer Image Path", "Footer Image Width", "Footer Image Height");3$pdf->PageNo("Page No Text", "Page No Sub Text", "Page No Image Path", "Page No Image Width", "Page No Image Height");4$pdf->Barcode("Barcode Text", "Barcode Sub Text", "Barcode Image Path", "Barcode Image Width", "Barcode Image Height");5$pdf->Qrcode("Qrcode Text", "Qrcode Sub Text", "Qrcode Image Path", "Qrcode Image Width", "Qrcode Image Height");6$pdf->Image("Image Text", "Image Sub Text", "Image Image Path", "Image Image Width", "Image Image Height");7$pdf->Text("Text Text", "Text Sub Text", "Text Image Path", "Text Image Width", "Text Image Height");8$pdf->Line("Line Text", "Line Sub Text", "Line Image Path", "Line Image Width", "Line Image Height");9$pdf->Table("Table Text", "Table Sub Text", "Table Image Path", "Table Image Width", "Table Image Height");10$pdf->Table("Table Text", "Table Sub Text", "Table Image Path", "Table Image Width", "Table Image Height");11$pdf->Table("Table Text", "Table Sub Text", "Table Image Path", "Table Image Width", "Table

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger Header code on LambdaTest Cloud Grid

Execute automation tests with Header on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful