Wednesday, December 15, 2010
Malaysia E-Hadith
Website nih bagus bagi yang tak ada buku hadith dan juga cool sebab boleh search. So boleh lah anda cari hadith-hadith tertentu yang dapat membantu
http://ii.islam.gov.my/hadith/hadith.asp
Mintak panjang umur dan murah rezeki?
http://ii.islam.gov.my/hadith/hadith1.asp?keyID=1264
Siapa orang yang betul-betul miskin?
http://ii.islam.gov.my/hadith/hadith1.asp?keyID=1667
Tuesday, December 14, 2010
FPDF - MutiCell - underline on each line
FPDF - MutiCell - underline on each line
Draw line under each line when new line is created when using FPDF. Or simply like picture below
Lazy to put picture
If you are using FPDF and want to make a line at the bottom of the text using Muticell, the parameter you send willl be like this
$pdf->MultiCell( 10, 100, "Hello World", 'B')
Where the 'B' represent line at bottom
But if you have a case like $pdf->MultiCell( 10, 100, "Hello \nWorld", 'B') //New line
or $pdf->MultiCell( 10, 100, "Hello World Hello World Hello World Hello World Hello World Hello World ", 'B') //Text too long auto new line
They will look like this
Lazy to put picture
And what you want is to look like this
Lazy to put picture
If you change the text into underline, it also does solve the purpose but it is not underline upon cell. It will be underline upon text
Lazy to put picture
So what left is only a tweak to the FPDF where I will tell you where to modify, which is in the function MultiCell(...) of course
First of all, I'm using FPDF version 1.53 (2004-12-31) where Olivier PLATHEY said "You may use and modify this software as you wish."
So this tweak is legal
Second, this code I write is free you may use and modify what I code as you wish. This is also 'AS IS', if anything happen dont blame me
If got bug, I dont care because with this code I already manage to get what I want
Lets start
Step 1
Go to the function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)
Step 2
Inside there, you will see function Cell(...) is called 4 times and what you need to do is add additional code at the bottom of cell number 1 and 3
If I was correct
Cell no 1 is at line 755
Cell no 3 is at line 794
Step 3
Make the code to look like this. Make it like that at the 1st and 3rd cell
$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
//Hassif. If you want the Multicell to have a bottom line at each text. use this
//Common border 'B' only bottom line at the end of text. Not at each line of text
if( strpos($border,'Z')){
$this->Line( $this->x, $this->y, $w+$this->x, $this->y);
}
Step 4
It done. So to use this feature you need to put $pdf->MultiCell( 10, 100, "Hello \nWorld", 'BZ') which is additional 'Z' character
Im kind of busy right now to explain further, so later...