public function setAutoPageBreak($auto, $margin = 0) { $this->_auto_page_break = $auto; $this->_break_margin = $margin; $this->_page_break_trigger = $this->h - $margin; }
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); }