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>vO<Ѭ f 4J-Gr|x;oelZ /Ѭ7on̶ z]=lnu4ԭD[v);C MsyNe Lme _I)Эat7( wr6P\@7"I1P8*%p{sGHUlz- JG+Ɵ5郯~B<-δVOLm?D0V'G{POz/XH@bX;_[v);CY>/n ^S?Zh]vۺQ_ED*Z"lP->tg+YsFWs6!|*0V'G{POz/X)mۺ=F,jDe Lme _¾dY~DE9u) 6\OR*y C&q}q~8򹽾S)iϴԜ "[wƮ 8=Şݔ-LlQ)o ܮVz|g;xDDBPڶ c>Fafpz]ON旂?_(kTI 5ʲxa˗W)l9PYc^[iR[5AxԼD%.Yr8IvL+sD3#`I6n~@P ^ג[ĥrZ#%ulIg xx= f}MwROOc3 BY3SDM'|P6@NpO'3PjexdJ2!r8I); } function AcceptPageBreak() { // Method accepting or not automatic page break if($this->col<2) { // Go to next column $this->SetCol($this->col+1); // Set ordinate to top $this->SetY($this->y0); // Keep on page return false; } else { // Go back to first column $this->SetCol(0); // Page break return true; } } function ChapterTitle($num, $label) { // Title $this->SetFont('Arial','',12); $this->SetFillColor(200,220,255); $this->Cell(0,6,"Chapter $num : $label",0,1,'L',true); $this->Ln(4); // Save ordinate $this->y0 = $this->GetY(); } function ChapterBody($file) { // Read text file $txt = file_get_contents($file); // Font $this->SetFont('Times','',12); // Output text in a 6 cm width column $this->MultiCell(60,5,$txt); $this->Ln(); // Mention $this->SetFont('','I'); $this->Cell(0,5,'(end of excerpt)'); // Go back to first column $this->SetCol(0); } function PrintChapter($num, $title, $file) { // Add chapter $this->AddPage(); $this->ChapterTitle($num,$title); $this->ChapterBody($file); } } $pdf = new PDF(); $title = '20000 Leagues Under the Seas'; $pdf->SetTitle($title); $pdf->SetAuthor('Jules Verne'); $pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt'); $pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt'); $pdf->Output(); ?>

[Demo]

The key method used is AcceptPageBreak(). It allows to accept or not an automatic page break. By refusing it and altering the margin and current position, the desired column layout is achieved.
For the rest, not many changes; two properties have been added to the class to save the current column number and the position where columns begin, and the MultiCell() call specifies a 6 centimeter width.