Horde_Pdf_Writer::setAutoPageBreak PHP Method

setAutoPageBreak() public method

When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.
public setAutoPageBreak ( boolean $auto, float $margin )
$auto boolean Boolean indicating if mode should be on or off.
$margin float Distance from the bottom of the page.
    public function setAutoPageBreak($auto, $margin = 0)
    {
        $this->_auto_page_break = $auto;
        $this->_break_margin = $margin;
        $this->_page_break_trigger = $this->h - $margin;
    }

Usage Example

コード例 #1
0
ファイル: WriterTest.php プロジェクト: jubinpatel/horde
 public function testAutoBreak()
 {
     $pdf = new Horde_Pdf_Writer(array('format' => array(50, 50), 'unit' => 'pt'));
     $pdf->setInfo('CreationDate', $this->fixtureCreationDate());
     $pdf->setCompression(false);
     $pdf->setMargins(0, 0);
     $pdf->setAutoPageBreak(true);
     $pdf->open();
     $pdf->addPage();
     $pdf->setFont('Courier', '', 10);
     $pdf->write(10, "Hello\nHello\nHello\nHello\nHello\nHello\nHello\n");
     $actual = $pdf->getOutput();
     $expected = $this->fixture('auto_break');
     $this->assertEquals($expected, $actual);
 }
All Usage Examples Of Horde_Pdf_Writer::setAutoPageBreak