PHPRtfLite::setBorder PHP Method

setBorder() public method

Sets border to rtf document. Sections may override this border.
public setBorder ( PHPRtfLite_Border $border )
$border PHPRtfLite_Border
    public function setBorder(PHPRtfLite_Border $border)
    {
        $this->_border = $border;
    }

Usage Example

The free software/open-source word processors AbiWord and OpenOffice.org can view and edit RTF files.

The default editor for Mac OS X, TextEdit, can also view and edit RTF files.

Since RTF files are text files, it\'s easy to produce RTF with many programming languages, like Perl, Java, C++, Pascal, COBOL, or Lisp. Perl, for example, has the RTF::Writer module for this purpose.
';
$times12 = new PHPRtfLite_Font(13, 'Times new Roman');
$arial14 = new PHPRtfLite_Font(14, 'Arial', '#000066');
$parFormat = new PHPRtfLite_ParFormat();
//rtf document
$rtf = new PHPRtfLite();
//borders
$borderFormatBlue = new PHPRtfLite_Border_Format(1, '#0000ff');
$borderFormatRed = new PHPRtfLite_Border_Format(2, '#ff0000');
$border = new PHPRtfLite_Border($rtf, $borderFormatBlue, $borderFormatRed, $borderFormatBlue, $borderFormatRed);
$rtf->setBorder($border);
$rtf->setBorderSurroundsHeader();
$rtf->setBorderSurroundsFooter();
//headers
$rtf->setOddEvenDifferent();
$header = $rtf->addHeader(PHPRtfLite_Container_Header::TYPE_LEFT);
$header->writeText("PHPRtfLite class library. Left document header. This is page - <pagenum> of <pagetotal> -", $times12, $parFormat);
$header = $rtf->addHeader(PHPRtfLite_Container_Header::TYPE_RIGHT);
$header->writeText("PHPRtfLite class library. Right document header. This is page - <pagenum> of <pagetotal> -", $times12, $parFormat);
//section 1
$sect = $rtf->addSection();
$sect->setPaperHeight(16);
$sect->setPaperWidth(25);
//Borders overridden: No Borders
$border = PHPRtfLite_Border::create($rtf, 0);
$sect->setBorder($border);