tFPDF::SetAutoPageBreak PHP Method

SetAutoPageBreak() public method

public SetAutoPageBreak ( $auto, $margin )
    function SetAutoPageBreak($auto, $margin = 0)
    {
        // Set auto page break mode and triggering margin
        $this->AutoPageBreak = $auto;
        $this->bMargin = $margin;
        $this->PageBreakTrigger = $this->h - $margin;
    }

Usage Example

コード例 #1
0
 /**
  * Creates content that should be printed
  *
  * @param Collection $collection
  * @return string
  */
 public function renderCollectionContent($collection)
 {
     $pdf = new \tFPDF('P', 'mm', [72, 80]);
     $pdf->SetMargins(0, 2);
     // Запретим автоматический разрыв страниц
     $pdf->SetAutoPageBreak(false, 0);
     $pdf->AddPage();
     $pdf->AddFont('arial', '', 'arial.ttf', true);
     $pdf->AddFont('arialbd', '', 'arialbd.ttf', true);
     $this->makeLine($pdf, Settings::get()->terminalName(), 10, 5)->makeLine($pdf, date('H:i:s d.m.Y', time()), 10, 5)->makeLine($pdf, $collection->sum . ' руб.', 16, 15, true)->makeLine($pdf, 'Инкассация:', 10, 10)->makeLine($pdf, (string) $collection->id, 12, 5)->makeLine($pdf, Settings::get()->contactInfo(), 8, 15)->makeLine($pdf, 'Сохраняйте чек', 8, 4);
     $fileName = __DIR__ . '/../runtime/pdf/collection_ticket.pdf';
     $pdf->Output($fileName, 'F');
     return $fileName;
 }
All Usage Examples Of tFPDF::SetAutoPageBreak