Jump to content

justify text in fpdf


sueirnaa

Recommended Posts

plz tell me code for justify text in fpdf...actually i want to generate some report to pdf using fpdf...but i dont know how to justify my text...anyone knows the code?
I found it here: justify text in fpdf
Link to comment
Share on other sites

no..i didn't found. i tried this code $pdf->Align(Justify); it doesn't works.
You looked through all 497 results and found nothing? In that case you might be better off using the forum on the FPDF site to ask this question: http://fpdf.org/ (click the "Forum" link)
Link to comment
Share on other sites

Have you tried this page?Roddy
yup..but still doesn't works..here is my code...
<?php//require('fpdf.php');require('force_justify.php');$pdf=new FPDF('P','mm','A4');$pdf->AddPage();//$pdf->setMargins(20,20,20,40);$pdf->SetFont('Arial','B',12);$pdf->cMargin=20;$pdf->tMargin=100;$pdf->SetFont('Arial', '');$pdf->Ln(2);$pdf->Write(10, "Rujukan : ");$pdf->Cell(250, 10, $_POST['txtrujukan']);$pdf->Write(7, "Tarikh : ");$pdf->Cell(7, 7, $_POST['select'] . ' ' . $_POST['select2'] . ' ' . $_POST['select3'] , 0, 5);$pdf->Ln(2);$pdf->write(10, $_POST['selectgelaran'] . ' ' . $_POST['nama'],1, 5);$pdf->Ln(2); $pdf->Write(5, "Suruhanjaya Perkhidmatan Awam Malaysia,Cawangan Sabah"); $pdf->SetFont('Arial', 'B');$pdf->Ln(5);$pdf->Write(5, "KOTA KINABALU");$pdf->Ln(5);$pdf->SetFont('Arial', '',12);$pdf->Write(5, "Tuan/Puan"); $pdf->Ln(10); $pdf->Write(5, "PELANTIKAN SEBAGAI "); $pdf->Cell(0, 5, $_POST['peranan']);$pdf->Write(5, " PEPERIKSAAN SURUHANJAYA PERKHIDMATAN AWAM MALAYSIA",0,'FJ',2);$pdf->Ln(10); $pdf->Write(5, "Saya dengan hormatnya memaklumkan bahawa Suruhanjaya",1,'FJ',1); $pdf->Write(5, "Perkhidmatan Awam Malaysia akan mengadakan ",1,1); $pdf->Cell(80, 5, $_POST['txtpep']); $pdf->Write(5,'pada',1,1,'FJ',5);$pdf->Cell(100, 5, $_POST['select4'] . ' ' . $_POST['select5'] . ' ' . $_POST['select6'] , 250, 2);$pdf->Ln(5); $pdf->Write(5, "2. Memandangkan kepada keperluan tenaga pengawas untuk mengendalikan peperiksaan ini, maka Urus setia ini dengan sukacitanya melantik tuan/puan sebagai "); $pdf->Cell(100, 5, $_POST['peranan']); $pdf->Write(5, "bagi peperiksaan tersebut di pusat seperti berikut :-");$pdf->Ln(10); $pdf->Cell(250, 5, $_POST['txtpusat']); $pdf->Ln(5); $pdf->Cell(250, 5, $_POST['txtalamat1']);$pdf->Ln(5); $pdf->Cell(250, 5, $_POST['txtalamat2']); $pdf->Ln(5); $pdf->Cell(250, 5, $_POST['txtalamat3']);$pdf->Ln(10);$pdf->Write(5, "3. Dengan pelantikan ini, Urus setia ini menaruh penuh harapan semoga tuan/puan akan memberikan kerjasama yang sepenuhnya untuk melaksana dan menjayakan peperiksaan ini",1,1,'FJ',1); $pdf->Write(5, "Sekian, terima kasih");$pdf->SetFont('Arial','B',12);$pdf->Ln(5);$pdf->Write(5, "“BERSAMA MENGGALAS TRANSFORMASI”“BERKHIDMAT UNTUK NEGARA”");$pdf->SetFont('Arial','',12);$pdf->Ln(5);$pdf->Write(5, "Saya yang menurut perintah");$pdf->Ln(20);$pdf->Cell(250, 5, $_POST['select7']);$pdf->Ln(5);$pdf->Cell(100, 5, $_POST['select8']);$pdf->Ln(5);$pdf->Write(5, "Suruhanjaya Perkhidmatan Awam Malaysia");$pdf->Ln(5);$pdf->Write(5, "Cawangan Sabah");$pdf->Output();?>
Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...