[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
siami
/
fpdf
/
doc182-html-id
/
[
Home
]
File: acceptpagebreak.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>AcceptPageBreak</title> <link type="text/css" rel="stylesheet" href="fpdf.css"> </head> <body> <h1>AcceptPageBreak</h1> <code><b>boolean</b> AcceptPageBreak()</code> <h2>Deskripsi</h2> Apabila kondisi untuk berganti ke halaman baru terpenuhi, maka metode ini dipanggil, dan ganti halaman atau tidak tergantung nilai kembalian. Secara <em>default</em> metode ini mengembalikan nilai yang tergantung mode yang dipilih dengan metode SetAutoPageBreak(). <br> Metode ini dipanggil secara otomatis dan disarankan untuk tidak memanggilnya secara langsung dalam aplikasi. <h2>Contoh</h2> Metode ini ditimpa (<em>override</em>) dalam <em>class</em> turunan (<em>inherited class</em>) untuk membuat dokumen dengan 3 kolom: <div class="doc-source"> <pre><code>class PDF extends FPDF { var $col=0; function SetCol($col) { //Pindahkan posisi ke sebuah kolom $this->col=$col; $x=10+$col*65; $this->SetLeftMargin($x); $this->SetX($x); } function AcceptPageBreak() { if($this->col<2) { //Ke kolom selanjutnya $this->SetCol($this->col+1); $this->SetY(10); return false; } else { //Kembali ke kolom pertama dan menempatkan page break $this->SetCol(0); return true; } } } $pdf=new PDF(); $pdf->AddPage(); $pdf->SetFont('Arial','',12); for($i=1;$i<=300;$i++) $pdf->Cell(0,5,"Line $i",0,1); $pdf->Output();</code></pre> </div> <h2>Lihat juga</h2> <a href="setautopagebreak.htm">SetAutoPageBreak</a> <hr style="margin-top:1.5em"> <div style="text-align:center"><a href="index.htm">Indeks</a></div> </body> </html>