diff --git a/samples/old/AdvancedTable.php b/samples/old/AdvancedTable.php deleted file mode 100755 index 021cd920..00000000 --- a/samples/old/AdvancedTable.php +++ /dev/null @@ -1,52 +0,0 @@ -createSection(); - -// Define table style arrays -$styleTable = array('borderSize'=>6, 'borderColor'=>'006699', 'cellMargin'=>80); -$styleFirstRow = array('borderBottomSize'=>18, 'borderBottomColor'=>'0000FF', 'bgColor'=>'66BBFF'); - -// Define cell style arrays -$styleCell = array('valign'=>'center'); -$styleCellBTLR = array('valign'=>'center', 'textDirection'=>PHPWord_Style_Cell::TEXT_DIR_BTLR); - -// Define font style for first row -$fontStyle = array('bold'=>true, 'align'=>'center'); - -// Add table style -$PHPWord->addTableStyle('myOwnTableStyle', $styleTable, $styleFirstRow); - -// Add table -$table = $section->addTable('myOwnTableStyle'); - -// Add row -$table->addRow(900); - -// Add cells -$table->addCell(2000, $styleCell)->addText('Row 1', $fontStyle); -$table->addCell(2000, $styleCell)->addText('Row 2', $fontStyle); -$table->addCell(2000, $styleCell)->addText('Row 3', $fontStyle); -$table->addCell(2000, $styleCell)->addText('Row 4', $fontStyle); -$table->addCell(500, $styleCellBTLR)->addText('Row 5', $fontStyle); - -// Add more rows / cells -for($i = 1; $i <= 10; $i++) { - $table->addRow(); - $table->addCell(2000)->addText("Cell $i"); - $table->addCell(2000)->addText("Cell $i"); - $table->addCell(2000)->addText("Cell $i"); - $table->addCell(2000)->addText("Cell $i"); - - $text = ($i % 2 == 0) ? 'X' : ''; - $table->addCell(500)->addText($text); -} - - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('AdvancedTable.docx'); diff --git a/samples/old/BasicTable.php b/samples/old/BasicTable.php deleted file mode 100755 index 6bd8336a..00000000 --- a/samples/old/BasicTable.php +++ /dev/null @@ -1,25 +0,0 @@ -createSection(); - -// Add table -$table = $section->addTable(); - -for($r = 1; $r <= 10; $r++) { // Loop through rows - // Add row - $table->addRow(); - - for($c = 1; $c <= 5; $c++) { // Loop through cells - // Add Cell - $table->addCell(1750)->addText("Row $r, Cell $c"); - } -} - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('BasicTable.docx'); diff --git a/samples/old/HeaderFooter.php b/samples/old/HeaderFooter.php deleted file mode 100755 index ae3ce5ac..00000000 --- a/samples/old/HeaderFooter.php +++ /dev/null @@ -1,56 +0,0 @@ -createSection(); - -// Add first page header -$header = $section->createHeader(); -$header->firstPage(); -$table = $header->addTable(); -$table->addRow(); -$table->addCell(4500)->addText('This is the header.'); -$table->addCell(4500)->addImage('_earth.jpg', array('width'=>50, 'height'=>50, 'align'=>'right')); - -// Add header for all other pages -$subsequent = $section->createHeader(); -$subsequent->addText("Subsequent pages in Section 1 will Have this!"); - -// Add footer -$footer = $section->createFooter(); -$footer->addPreserveText('Page {PAGE} of {NUMPAGES}.', array('align'=>'center')); - -// Write some text -$section->addTextBreak(); -$section->addText('Some text...'); - -// Create a second page -$section->addPageBreak(); - -// Write some text -$section->addTextBreak(); -$section->addText('Some text...'); - -// Create a third page -$section->addPageBreak(); - -// Write some text -$section->addTextBreak(); -$section->addText('Some text...'); - -// New portrait section -$section2 = $PHPWord->createSection(); - -$sec2Header = $section2->createHeader(); -$sec2Header->addText("All pages in Section 2 will Have this!"); - -// Write some text -$section2->addTextBreak(); -$section2->addText('Some text...'); - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('HeaderFooter.docx'); diff --git a/samples/old/Image.php b/samples/old/Image.php deleted file mode 100755 index 5018e206..00000000 --- a/samples/old/Image.php +++ /dev/null @@ -1,23 +0,0 @@ -createSection(); - -// Add image elements -$section->addImage('_mars.jpg'); -$section->addTextBreak(2); - -$section->addImage('_earth.jpg', array('width'=>210, 'height'=>210, 'align'=>'center')); -$section->addTextBreak(2); - -$section->addImage('_mars.jpg', array('width'=>100, 'height'=>100, 'align'=>'right')); - - - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('Image.docx'); diff --git a/samples/old/Link.php b/samples/old/Link.php deleted file mode 100755 index 8ad5575e..00000000 --- a/samples/old/Link.php +++ /dev/null @@ -1,23 +0,0 @@ -createSection(); - -// Add hyperlink elements -$section->addLink('http://www.google.com', 'Best search engine', array('color'=>'0000FF', 'underline'=>PHPWord_Style_Font::UNDERLINE_SINGLE)); -$section->addTextBreak(2); - -$PHPWord->addLinkStyle('myOwnLinkStyle', array('bold'=>true, 'color'=>'808000')); -$section->addLink('http://www.bing.com', null, 'myOwnLinkStyle'); -$section->addLink('http://www.yahoo.com', null, 'myOwnLinkStyle'); - - - - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('Link.docx'); diff --git a/samples/old/ListItem.php b/samples/old/ListItem.php deleted file mode 100755 index e0125980..00000000 --- a/samples/old/ListItem.php +++ /dev/null @@ -1,46 +0,0 @@ -createSection(); - -// Add listitem elements -$section->addListItem('List Item 1', 0); -$section->addListItem('List Item 2', 0); -$section->addListItem('List Item 3', 0); -$section->addTextBreak(2); - -// Add listitem elements -$section->addListItem('List Item 1', 0); -$section->addListItem('List Item 1.1', 1); -$section->addListItem('List Item 1.2', 1); -$section->addListItem('List Item 1.3 (styled)', 1, array('bold'=>true)); -$section->addListItem('List Item 1.3.1', 2); -$section->addListItem('List Item 1.3.2', 2); -$section->addTextBreak(2); - -// Add listitem elements -$listStyle = array('listType'=>PHPWord_Style_ListItem::TYPE_NUMBER); -$section->addListItem('List Item 1', 0, null, $listStyle); -$section->addListItem('List Item 2', 0, null, $listStyle); -$section->addListItem('List Item 3', 0, null, $listStyle); -$section->addTextBreak(2); - -// Add listitem elements -$PHPWord->addFontStyle('myOwnStyle', array('color'=>'FF0000')); -$PHPWord->addParagraphStyle('P-Style', array('spaceAfter'=>95)); -$listStyle = array('listType'=>PHPWord_Style_ListItem::TYPE_NUMBER_NESTED); -$section->addListItem('List Item 1', 0, 'myOwnStyle', $listStyle, 'P-Style'); -$section->addListItem('List Item 2', 0, 'myOwnStyle', $listStyle, 'P-Style'); -$section->addListItem('List Item 3', 1, 'myOwnStyle', $listStyle, 'P-Style'); -$section->addListItem('List Item 4', 1, 'myOwnStyle', $listStyle, 'P-Style'); -$section->addListItem('List Item 5', 2, 'myOwnStyle', $listStyle, 'P-Style'); -$section->addListItem('List Item 6', 1, 'myOwnStyle', $listStyle, 'P-Style'); -$section->addListItem('List Item 7', 0, 'myOwnStyle', $listStyle, 'P-Style'); - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('ListItem.docx'); diff --git a/samples/old/Object.php b/samples/old/Object.php deleted file mode 100755 index b54df971..00000000 --- a/samples/old/Object.php +++ /dev/null @@ -1,19 +0,0 @@ -createSection(); - -// Add text elements -$section->addText('You can open this OLE object by double clicking on the icon:'); -$section->addTextBreak(2); - -// Add object -$section->addObject('_sheet.xls'); - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('Object.docx'); diff --git a/samples/old/Section.php b/samples/old/Section.php deleted file mode 100755 index 875e9fc2..00000000 --- a/samples/old/Section.php +++ /dev/null @@ -1,25 +0,0 @@ -createSection(array('borderColor'=>'00FF00', 'borderSize'=>12)); -$section->addText('I am placed on a default section.'); - -// New landscape section -$section = $PHPWord->createSection(array('orientation'=>'landscape')); -$section->addText('I am placed on a landscape section. Every page starting from this section will be landscape style.'); -$section->addPageBreak(); -$section->addPageBreak(); - -// New portrait section -$section = $PHPWord->createSection(array('marginLeft'=>600, 'marginRight'=>600, 'marginTop'=>600, 'marginBottom'=>600)); -$section->addText('This section uses other margins.'); - - - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('Section.docx'); diff --git a/samples/old/Template.php b/samples/old/Template.php deleted file mode 100755 index 1b4472b1..00000000 --- a/samples/old/Template.php +++ /dev/null @@ -1,22 +0,0 @@ -loadTemplate('Template.docx'); - -$document->setValue('Value1', 'Sun'); -$document->setValue('Value2', 'Mercury'); -$document->setValue('Value3', 'Venus'); -$document->setValue('Value4', 'Earth'); -$document->setValue('Value5', 'Mars'); -$document->setValue('Value6', 'Jupiter'); -$document->setValue('Value7', 'Saturn'); -$document->setValue('Value8', 'Uranus'); -$document->setValue('Value9', 'Neptun'); -$document->setValue('Value10', 'Pluto'); - -$document->setValue('weekday', date('l')); -$document->setValue('time', date('H:i')); - -$document->save('Solarsystem.docx'); diff --git a/samples/old/Textrun.php b/samples/old/Textrun.php deleted file mode 100755 index 3fa12d97..00000000 --- a/samples/old/Textrun.php +++ /dev/null @@ -1,31 +0,0 @@ -createSection(); - -// Add style definitions -$PHPWord->addParagraphStyle('pStyle', array('spacing'=>100)); -$PHPWord->addFontStyle('BoldText', array('bold'=>true)); -$PHPWord->addFontStyle('ColoredText', array('color'=>'FF8080')); -$PHPWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline'=>PHPWord_Style_Font::UNDERLINE_SINGLE)); - -// Add text elements -$textrun = $section->createTextRun('pStyle'); - -$textrun->addText('Each textrun can contain native text or link elements.'); -$textrun->addText(' No break is placed after adding an element.', 'BoldText'); -$textrun->addText(' All elements are placed inside a paragraph with the optionally given p-Style.', 'ColoredText'); -$textrun->addText(' The best search engine: '); -$textrun->addLink('http://www.google.com', null, 'NLink'); -$textrun->addText('. Also not bad: '); -$textrun->addLink('http://www.bing.com', null, 'NLink'); - - - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('Textrun.docx'); diff --git a/samples/old/TitleTOC.php b/samples/old/TitleTOC.php deleted file mode 100755 index 376d26e8..00000000 --- a/samples/old/TitleTOC.php +++ /dev/null @@ -1,48 +0,0 @@ -createSection(); - -// Define the TOC font style -$fontStyle = array('spaceAfter'=>60, 'size'=>12); - -// Add title styles -$PHPWord->addTitleStyle(1, array('size'=>20, 'color'=>'333333', 'bold'=>true)); -$PHPWord->addTitleStyle(2, array('size'=>16, 'color'=>'666666')); - -// Add text elements -$section->addText('Table of contents:'); -$section->addTextBreak(2); - -// Add TOC -$section->addTOC($fontStyle); - -// Add Titles -$section->addPageBreak(); -$section->addTitle('I am Title 1', 1); -$section->addText('Some text...'); -$section->addTextBreak(2); - -$section->addTitle('I am a Subtitle of Title 1', 2); -$section->addTextBreak(2); -$section->addText('Some more text...'); -$section->addTextBreak(2); - -$section->addTitle('Another Title (Title 2)', 1); -$section->addText('Some text...'); -$section->addPageBreak(); -$section->addTitle('I am Title 3', 1); -$section->addText('And more text...'); -$section->addTextBreak(2); -$section->addTitle('I am a Subtitle of Title 3', 2); -$section->addText('Again and again, more text...'); - -echo 'Note: The pagenumbers in the TOC doesnt refresh automatically.'; - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('TitleTOC.docx'); diff --git a/samples/old/Watermark.php b/samples/old/Watermark.php deleted file mode 100755 index 319221c1..00000000 --- a/samples/old/Watermark.php +++ /dev/null @@ -1,20 +0,0 @@ -createSection(); - -// Create header -$header = $section->createHeader(); - -// Add a watermark to the header -$header->addWatermark('_earth.jpg', array('marginTop'=>200, 'marginLeft'=>55)); - -$section->addText('The header reference to the current section includes a watermark image.'); - -// Save File -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); -$objWriter->save('Watermark.docx'); diff --git a/samples/old/_earth.jpg b/samples/old/_earth.jpg deleted file mode 100644 index 28537b06..00000000 Binary files a/samples/old/_earth.jpg and /dev/null differ diff --git a/samples/old/_mars.jpg b/samples/old/_mars.jpg deleted file mode 100644 index 584d3171..00000000 Binary files a/samples/old/_mars.jpg and /dev/null differ diff --git a/samples/old/_sheet.xls b/samples/old/_sheet.xls deleted file mode 100644 index b8da43c6..00000000 Binary files a/samples/old/_sheet.xls and /dev/null differ