0

I have been trying to find out why my FPDF cell alignment isn't working. Below is the code I am using. This is the result of the below code. When the below code outputs the pdf, the text is written outside the right side of the cell. I have a similar program (on the same system and using the same FPDF files) using the same logic and it works fine. I have looked online for other people having this issue but wasn't able to produce any useful results.

function ShowPDF()
{
  require_once('FPDF/fpdf.php');
  $pdf = new FPDF();

  $pdf->AddPage();
  $pdf->SetAutoPageBreak(false);
  $pdf->SetFontSize(11);
  $pdf->SetTextColor(0,0,0);

  $TOTALWITH = 400000;
  $pdf->Cell(135,15,"Test",1,1,"R",false);

  $pdf->Output("Alignment.pdf", 'I');       
}

Does anyone know of anything that might cause or fix this issue?

Thank you, Ernie

Edit: Image displaying output. FPDF Right Align Result

Ehaver282
  • 101
  • 2
  • 14
  • can you share some image or screensort? – Rupal Jan 18 '18 at 18:18
  • When I use your code, i have an error: `FPDF error: No font has been set`. Have you set this on a other place? When I add these code of line it works as expected. Can you post your full process of pdf creation? – Martin Jan 20 '18 at 09:48

0 Answers0