Niente ho risolto da sola modificando un po' il file fpdf.php.
Spiego in breve, nel caso che qualcuno si trovi nella mia situazione...
Nella dichiarazione delle variabili iniziale ho aggiunto la riga che segnalo con *
codice:
class FPDF
{
var $page; //current page number
* var $page2=0;
var $n; //current object number
var $offsets; //array of object offsets
var $buffer; //buffer holding in-memory PDF
var $pages; //array containing pages
var $state; //current document state
.......
Ho modificato il costruttore così
codice:
function FPDF($orientation='P', $unit='mm', $format='A4')
{
//Some checks
$this->_dochecks();
//Initialization of properties
$this->page=0;
* $this->page2=0;
$this->n=2;
$this->buffer='';
..............
Ed infine ho modificato la funzione _beginpage così
codice:
function _beginpage($orientation, $format)
{
*if ($this->page!=$this->page2){
* $this->page++;
* $this->state=2;
* $this->x=$this->lMargin;
* $this->y=$this->tMargin;
* $this->FontFamily='';
* //Check page size
* if($orientation=='')
* $orientation=$this->DefOrientation;
* else
* $orientation=strtoupper($orientation[0]);
* if($format=='')
* $format=$this->DefPageFormat;
* else
* {
* if(is_string($format))
* $format=$this->_getpageformat($format);
* }
* if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1])
* {
* //New size
* if($orientation=='P')
* {
* $this->w=$format[0];
* $this->h=$format[1];
* }
* else
* {
* $this->w=$format[1];
* $this->h=$format[0];
* }
* $this->wPt=$this->w*$this->k;
* $this->hPt=$this->h*$this->k;
* $this->PageBreakTrigger=$this->h-$this->bMargin;
* $this->CurOrientation=$orientation;
* $this->CurPageFormat=$format;
* }
* if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1])
* $this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
*}else{
$this->page++;
* $this->page2++;
$this->pages[$this->page]='';
$this->state=2;
$this->x=$this->lMargin;
$this->y=$this->tMargin;
$this->FontFamily='';
//Check page size
if($orientation=='')
$orientation=$this->DefOrientation;
else
$orientation=strtoupper($orientation[0]);
if($format=='')
$format=$this->DefPageFormat;
else
{
if(is_string($format))
$format=$this->_getpageformat($format);
}
if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1])
{
//New size
if($orientation=='P')
{
$this->w=$format[0];
$this->h=$format[1];
}
else
{
$this->w=$format[1];
$this->h=$format[0];
}
$this->wPt=$this->w*$this->k;
$this->hPt=$this->h*$this->k;
$this->PageBreakTrigger=$this->h-$this->bMargin;
$this->CurOrientation=$orientation;
$this->CurPageFormat=$format;
}
if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1])
$this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
*}
}
Con * ho segnalato l'area che ho inserito
In più, nella mia pagina ho aggiunto questo
codice:
if ( $iniziopagina != $finepagina ) {
$pdf->page = $iniziopagina;
*$pdf->page2 = $finepagina;
}
Quando riaggiornavo la posizione della pagina
Grazie ;-)
Ciao ciao