@@ -25,36 +25,53 @@ folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
2525 $section = $phpWord->addSection();
2626 // Adding Text element to the Section having font styled by default...
2727 $section->addText(
28- htmlspecialchars('"Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning." (Albert Einstein)')
28+ htmlspecialchars(
29+ '"Learn from yesterday, live for today, hope for tomorrow. '
30+ . 'The important thing is not to stop questioning." '
31+ . '(Albert Einstein)'
32+ )
2933 );
3034
3135 /*
32- * Note: it is possible to customize font style of the Text element you add in three ways:
36+ * Note: it's possible to customize font style of the Text element you add in three ways:
3337 * - inline;
3438 * - using named font style (new font style object will be implicitly created);
3539 * - using explicitly created font style object.
3640 */
3741
38- // Adding Text element having font customized inline...
42+ // Adding Text element with font customized inline...
3943 $section->addText(
40- htmlspecialchars('"Great achievement is usually born of great sacrifice, and is never the result of selfishness." (Napoleon Hill)'),
44+ htmlspecialchars(
45+ '"Great achievement is usually born of great sacrifice, '
46+ . 'and is never the result of selfishness." '
47+ . '(Napoleon Hill)'
48+ ),
4149 array('name' => 'Tahoma', 'size' => 10)
4250 );
4351
44- // Adding Text element having font customized using named font style...
52+ // Adding Text element with font customized using named font style...
4553 $fontStyleName = 'oneUserDefinedStyle';
46- $phpWord->addFontStyle($fontStyleName, array('name' => 'Tahoma', 'size' => 10, 'color' => '1B2232', 'bold' => true));
54+ $phpWord->addFontStyle(
55+ $fontStyleName,
56+ array('name' => 'Tahoma', 'size' => 10, 'color' => '1B2232', 'bold' => true)
57+ );
4758 $section->addText(
48- htmlspecialchars('"The greatest accomplishment is not in never falling, but in rising again after you fall." (Vince Lombardi)'),
59+ htmlspecialchars(
60+ '"The greatest accomplishment is not in never falling, '
61+ . 'but in rising again after you fall." '
62+ . '(Vince Lombardi)'
63+ ),
4964 $fontStyleName
5065 );
5166
52- // Adding Text element having font customized using explicitly created font style object...
67+ // Adding Text element with font customized using explicitly created font style object...
5368 $fontStyle = new \PhpOffice\PhpWord\Style\Font();
5469 $fontStyle->setBold(true);
5570 $fontStyle->setName('Tahoma');
5671 $fontStyle->setSize(13);
57- $myTextElement = $section->addText(htmlspecialchars('"Believe you can and you\'re halfway there." (Theodor Roosevelt)'));
72+ $myTextElement = $section->addText(
73+ htmlspecialchars('"Believe you can and you\'re halfway there." (Theodor Roosevelt)')
74+ );
5875 $myTextElement->setFontStyle($fontStyle);
5976
6077 // Saving the document as OOXML file...
@@ -69,8 +86,8 @@ folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
6986 $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
7087 $objWriter->save('helloWorld.html');
7188
72- /* Note: RTF was skipped here , because the format is not XML-based and requires a bit different example. */
73- /* Note: PDF was skipped here , because we use "HTML-to-PDF" approach to create PDF documents. */
89+ /* Note: we skip RTF , because it's not XML-based and requires a different example. */
90+ /* Note: we skip PDF , because "HTML-to-PDF" approach is used to create PDF documents. */
7491
7592 Settings
7693--------
0 commit comments