How to use WriteStatement method of pts_pdf_template class

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

dump_documentation.php

Source:dump_documentation.php Github

copy

Full Screen

...23 $html_doc = new pts_html_template(pts_core::program_title(false), 'Test Client Documentation');24 $pdf->AddPage();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

WriteStatement

Using AI Code Generation

copy

Full Screen

1$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);2$pdf->Ln();3$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);4$pdf->Ln();5$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);6$pdf->Ln();7$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);8$pdf->Ln();9$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);10$pdf->Ln();11$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);12$pdf->Ln();13$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);14$pdf->Ln();15$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);16$pdf->Ln();17$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);18$pdf->Ln();19$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);20$pdf->Ln();21$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);22$pdf->Ln();23$pdf->WriteStatement($pdf->GetX(), $pdf->GetY(), $text);24$pdf->Ln();25$pdf->WriteStatement($pdf

Full Screen

Full Screen

WriteStatement

Using AI Code Generation

copy

Full Screen

1$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);2$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);3$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);4$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);5$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);6$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);7$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);8$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);9$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);10$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);11$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);12$pdf->WriteStatement(10, 10, 10, 10, 'Sample statement', 10);

Full Screen

Full Screen

WriteStatement

Using AI Code Generation

copy

Full Screen

1$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');2$pdf->Output();3$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');4$pdf->Output();5$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');6$pdf->Output();7$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');8$pdf->Output();9$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');10$pdf->Output();11$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');12$pdf->Output();13$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');14$pdf->Output();15$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');16$pdf->Output();17$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');18$pdf->Output();19$pdf->WriteStatement(1, 1, 1, 1, 'This is a test');20$pdf->Output();

Full Screen

Full Screen

WriteStatement

Using AI Code Generation

copy

Full Screen

1$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "B");2$pdf->Output();3$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "BI");4$pdf->Output();5$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "I");6$pdf->Output();7$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "U");8$pdf->Output();9$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "D");10$pdf->Output();11$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "DB");12$pdf->Output();13$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "DI");14$pdf->Output();15$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "DU");16$pdf->Output();17$pdf->WriteStatement(10, 10, 10, "This is a sample text", 10, "Times", "IB");18$pdf->Output();19$pdf->WriteStatement(10, 10, 10, "This is a sample text",

Full Screen

Full Screen

WriteStatement

Using AI Code Generation

copy

Full Screen

1$pts_pdf->WriteStatement($text, $font, $font_size, $x, $y);2$pts_pdf->WriteImage($image_path, $x, $y, $w, $h);3$pts_pdf->WriteTable($table, $x, $y, $w, $h, $header, $font, $font_size, $cell_height);4$pts_pdf->WriteTable($table, $x, $y, $w, $h, $header, $font, $font_size, $cell_height);5$pts_pdf->WriteTable($table, $x, $y, $w, $h, $header, $font, $font_size, $cell_height);6$pts_pdf->WriteTable($table, $x, $y, $w, $h, $header, $font, $font_size, $cell_height);7$pts_pdf->WriteTable($table, $x, $y, $w, $h, $header, $font, $font_size, $cell_height);8$pts_pdf->WriteTable($table, $x, $y, $w, $h, $header, $font, $font_size, $cell_height);

Full Screen

Full Screen

WriteStatement

Using AI Code Generation

copy

Full Screen

1require_once("class.pdf_template.php");2$pdf = new pts_pdf_template();3$pdf->SetAuthor("Author Name");4$pdf->SetSubject("Subject");5$pdf->SetKeywords("Keywords");6$pdf->SetCreator("Creator");7$pdf->SetCreator("Creator");8$pdf->SetMargins(25, 25, 25, 25);9$pdf->SetAutoPageBreak(true, 25);10$pdf->SetLineWidth(1);11$pdf->SetDrawColor(0, 0, 0);12$pdf->SetTextColor(0, 0, 0);13$pdf->SetFillColor(255, 255, 255);14$pdf->SetFont("Times", "", 12);15$pdf->CreatePDF("2.pdf");16$pdf->WriteStatement("This is the first line of the document");17$pdf->WriteStatement("This is the second line of the document");18$pdf->WriteStatement("This is the third line of the document");19$pdf->WriteStatement("This is the fourth line of the document");20$pdf->WriteStatement("This is the fifth line of the document");21$pdf->WriteStatement("This is the sixth line of the document");22$pdf->WriteStatement("This is the seventh line of the document");23$pdf->WriteStatement("This is the eighth line of the document");24$pdf->WriteStatement("This is the ninth line of the document");25$pdf->WriteStatement("This is the tenth line of the document");26$pdf->WriteStatement("This is the eleventh line of the document");27$pdf->WriteStatement("This is the twelfth line of the document");28$pdf->WriteStatement("This is the thirteenth line of the document");29$pdf->WriteStatement("This is the fourteenth line of the document");30$pdf->WriteStatement("This is the fifteenth line of the document");31$pdf->WriteStatement("This is the sixteenth line of the document");32$pdf->WriteStatement("This is the seventeenth line of the document");33$pdf->WriteStatement("This is the eighteenth line of the document");34$pdf->WriteStatement("This is the nineteenth line of the document");35$pdf->WriteStatement("This is the twentieth line of the document");36$pdf->WriteStatement("This is the twenty-first line of the document");

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 WriteStatement code on LambdaTest Cloud Grid

Execute automation tests with WriteStatement 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