phphtmlpdffpdf

HTML2FPDF - Positioning the writeHTML output


I have the following code:

function convert($contents, $name){ 
  echo($link); //prints nothing
  $pdf=new HTML2FPDF();
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10, "Entry Report");
  $pdf->SetFont('Arial', '', 12);
  $pdf->Cell(100,10, $_SESSION['currdate']);
  $pdf->WriteHTML( $contents );
  $pdf->Output($name, "D");
}

By default the writeHTML content is positioned within the PDF at the top...How do I offset the wrriten content that is placed in the pdf by the writeHTML function...


Solution

  • In FPDF you can use SetX(), SetY() or SetXY().