brida Le 13/09/2011 à 17:45 Bonsoir Spipu,
Comme puis-je faire pour avoir une marge de haut (backtop) différente sur la 2ième page de mon document PDF dès que le texte s'affiche sur cette même 2ième page ?
Tout en sachant que je ne connais à partir de quel moment si le PDF va générer une 2ième page.
Que dois-modifier dans le code de html2pdf pour permettre cela ?
Merci pour ton aide.
Spipu Le 14/09/2011 à 10:59 ce n'est pas implémenté dans HTML2PDF
il faudrait modifier la méthode _setNewPage pour modifier backtop à partir de la 2eme page
brida Le 15/09/2011 à 20:12 Merci pour ta réponse Spipu.
Peux-tu me donner un exemple de code car je suis novice en la matière
merci
brida Le 15/09/2011 à 20:29 **
* création d'une nouvelle page avec le format et l'orientation spécifies
*
* @param mixed format de la page : A5, A4, array(width, height)
* @param string sens P=portrait ou L=landscape
* @param array tableau des propriétés du fond de la page
* @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
* @return null
*/
function setNewPage($format = null, $orientation = '', $background = null, $curr = null)
{
$this->FirstPage = false;
$this->format = $format ? $format : $this->format;
$this->sens = $orientation ? $orientation : $this->sens;
$this->background = $background!==null ? $background : $this->background;
$this->maxY = 0;
$this->maxX = 0;
$this->maxH = 0;
$this->pdf->lMargin = $this->defaultLeft;
$this->pdf->rMargin = $this->defaultRight;
$this->pdf->tMargin = $this->defaultTop;
$this->pdf->AddPage($this->sens, $this->format);
$this->page++;
if (!$this->sub_part && !$this->isSubPart)
{
if (is_array($this->background))
{
if (isset($this->background['color']) && $this->background['color'])
{
$this->pdf->setMyFillColor($this->background['color']);
$this->pdf->Rect(0, 0, $this->pdf->w, $this->pdf->h, 'F');
}
if (isset($this->background['img']) && $this->background['img'])
$this->pdf->Image($this->background['img'], $this->background['posX'], $this->background['posY'], $this->background['width']);
}
$this->SetPageHeader();
$this->SetPageFooter();
}
$this->setMargins();
$this->pdf->y = $this->margeTop;
$this->setNewPositionForNewLine($curr);
$this->maxH = 0;
}