PHPRtfLite::addFooter PHP Метод

addFooter() публичный Метод

creates footer for the document
public addFooter ( string $type = PHPRtfLite_Container_Footer::TYPE_ALL, PHPRtfLite_Container_Footer $footer = null ) : PHPRtfLite_Container_Footer
$type string Represented by class constants PHPRtfLite_Container_Footer::TYPE_*
Possible values:
PHPRtfLite_Container_Footer::TYPE_ALL all pages (different odd and even headers/footers must be not set)
PHPRtfLite_Container_Footer::TYPE_LEFT left pages (different odd and even headers/footers must be set)
PHPRtfLite_Container_Footer::TYPE_RIGHT right pages (different odd and even headers/footers must be set)
PHPRtfLite_Container_Footer::TYPE_FIRST first page
$footer PHPRtfLite_Container_Footer
Результат PHPRtfLite_Container_Footer
    public function addFooter($type = PHPRtfLite_Container_Footer::TYPE_ALL, PHPRtfLite_Container_Footer $footer = null)
    {
        if ($footer === null) {
            $footer = new PHPRtfLite_Container_Footer($this, $type);
        }
        $this->_footers[$type] = $footer;
        return $footer;
    }

Usage Example

Пример #1
0
<?php

require_once 'src/PHPRtfLite.php';
PHPRtfLite::registerAutoloader();
require_once 'includes/cars_pdo.php';
if (isset($_POST['download'])) {
    try {
        $rtf = new PHPRtfLite();
        // Установить свойства страницы
        $rtf->setMargins(2.54, 2.54, 2.54, 2.54);
        $rtf->setPaperFormat(PHPRtfLite::PAPER_LETTER);
        // Добавить футер
        $footer = $rtf->addFooter();
        $fontFooter = new PHPRtfLite_Font(8, 'Arial', '#000000');
        $alignFooter = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER);
        $footer->writeText('Used cars for sale - <pagenum>', $fontFooter, $alignFooter);
        // Определить шрифты
        $fontH1 = new PHPRtfLite_Font(16, 'Arial', '#4E9C93');
        $fontH2 = new PHPRtfLite_Font(14, 'Arial', '#4E9C93');
        $fontP = new PHPRtfLite_Font(12, 'Helvetica', '#000000');
        // Вертикальное форматирование текста
        $formatH1 = new PHPRtfLite_ParFormat();
        $formatH1->setSpaceAfter(8);
        $formatH2 = new PHPRtfLite_ParFormat();
        $formatH2->setSpaceAfter(6);
        $formatP = new PHPRtfLite_ParFormat();
        $formatP->setSpaceAfter(3);
        // Содержание страницы
        $section = $rtf->addSection();
        $section->writeText('Used Cars for Sale', $fontH1, $formatH1);
        while ($row = getRow($result)) {
All Usage Examples Of PHPRtfLite::addFooter