Assalam o aliekum dosto.
aj say may PHP say PDF documents bnany k detailed tutorials start karny lga hu or mje umeed hy ap sab ko ye tutorials bht psnd ain gay.
PDF files aj kal internet per har jgah use ho rahi hain yea wo files hoti hy jinko ebooks kaha jata hy jin may books ka sara data ya koi magazine ya article para hota hy. Koi bhi data agr ap PDF document may output krwana chahty hain esky lye PHP use ki jati hy or us say yea bht easily ho jata hy.
en tutorials may, may basics say start karu ga or phr end tk aapko sara course karwaoun ga k kis trah aaap pdf files create kar sakty hain PHP ko use karty huye or usay option bhi de sakty hain k chahy to user esko download karly ya browser may view karly.
es tutorial ka video tutorial dekhny k lye yahn click karein.

1-PHP say PDF files bnany k lye FPDF k naam say ek library use ki jati hy jo actually PHP ki ek class hy. esay aap us php file may require_once use karty huye include kar lety hain jis may aap ny pdf generate karny ka function likhna hy...

2- www.fpdf.org
es website pe jaaa k library download karein or phr extract karein or jo folder extract ho k aye ga usay us folder may rakhein yahn wo functions ki file pari hy jis say pdf bnani hy... ab function ki file may jaa k aap require_once() use kar k fpdf k folder may say fpdf.php k name say file ko require kar len gay... es say fpdf k saray functions(methods) apko available ho jaein gay..

3-Ab ek new variable bnaein e.g

$a;
phr es variable k zarye apny FPDF ki class ko instantiate karna hy..

$a = new FPDF();

4-Ab bas FPDF k functions ko use karein or values dety jaein or PDF banti jaye ge.. misal k tor per hum yahn Cell() ka functions likhty hain. FPDF ka koi bhi function call karny ka yea tariqa hota hy

$a -> AddPage();.... ye function humary pdf page may ek page lga deta hy. esko aap esay smj sakty hain k jesay type writter may sab say ephly page algta hy phr ap typing start karty hain.

5-Ab typing start karny k lye aap sab say pehly ye done akrein gay k apny font konsa use karna hy or uska style or size kitna hoga. usky lye FPDF ka SetFont() function use hota hy

$a -> SetFont("Arial","",12);........yahn pehla argument wo font hy jo may ny use karna hy. yani yahn may Arial use kar rha hu.. dusra argument font ka style hy, yahn empty string ka matlab hy k regular style may use karu ga may, or 3sra argument font ka size hy.

6-Ab font done ho gya to hum ab writting start akr dete hain
Cell ka function actually humary pdf may ek cell yani k text ka ek block bnata hy, yea function 8 parameter leta hy:
pehlay 2 cell ki width or height hain.... teesra parameter wo text hy jo aapny es cell k ander likhna hy. agr aap yahn "" pass karein gay to cell may koi data nahi aye ga wo ek empty cell bn jye ga.
fourth parameter cell ko border lgany k lye hy ye 0 ya 1 value leta hy.. yahn 0 ka matlab ka koi border nahi lgana or 1 ka meaning hy k cell k gird border hoga as a frame. by default eska color black hy or wo change ho sakta hy jo Inshahallah apko or ksi lecture may btaoun ga k kesay.
fifth parameter ye define karta hy k agla anay wala es say k hisab say kahn jaye ga. ye 0, 1 ya 2 ko value k tor pe leta hy. 0 ka matlab hy k wo esky sath he right side pe lag jaye ga. jesay english likhty huye left to right chalty hain usi trah. 1 ka matlab hy k wo next line may bilkul left say ajye ga. or 2 means k wo es cell k, jis may hum kam kar rahy hain, bilkul nichay aye ga.
sixth parameter ye btata hy k cell k ander text align kesay hoga. yahn "C", "L", "R" ye 3 values may say koi ek jati hy. C ka matlab ka centered align, L ka amtlab hy elft align or R ka matlab hy right aligned. es say cell ky ander text cell may left right ya centered aligned ho jata hy cell bzaat e khud align nahi hota.
seventh paramter ye define karta hy k ye cell fill hoga ya nahi. yahn true ya false ko as values pass kia jata hy. true ka matlb hy k hoga fill or by default fill ka color white hy cell ka or false ka matlb hy k cel fill nahi hoga. fills ko may bad may discuss karu ga inshahallah.
Eighth parameter ek link hoti hy jo apny ksi website ki deni hoti hy. jesay "www.google.com.pk"
ye aap as a string pas kar dety hain.

$a -> Cell(95,10,"This is some text.",0,0,"C");

explaination:
yahn may ny width 95 points rakhi hy cell ki or height 10 points rakhi hy. text enter kia hy phr or border 0 hy phr, or usay bad next cell ki value 0 honay ka matlb hy k ab agla cell k esky bilkul sath right side pe aye ga ejsay tables may ata hy. phr alignment ko may ny center aligned kar dia hy jis say cell k ander jo text hy wo centered aligned ho gya hy cell may. yahn may ny akhri 2 parameters nahi dye or g han aap FPDF may jis marzi function may johnsa parameter chahein skip akr sakty hain mgar agr wo apky required parameters jesay k mje yahn alignment tk to required thy he lazmi, to agr wo un required parameters k baad aa rahy hon tab. vrna na karein. FPDF may har function may har parameter ki koi na koi default value set hy. fill ki false or link ko null.

7-to ab apka cell to ban gye data bhi chala gya mgar wo es time apky pc ki ram may hy, usay pdf may lanay k lye aap Output ka function call karein gay.

$a -> Output();
or aapki pdf ban k aapky samny ajye ge..
Note:agr apny IDM kia hua hy to wo download ho jye ge automaticlly vrna apky browser may show hogi.
es tutorial ki video dekhein yahn..

Dosto mje umeed hy apko zarur smj agya hoga or agr apka koi swal hy to zarur puchein... inshahallah may FPDF k zarye say pdf files generate karna pura explain karu ga pura course. mje follow karty jaein.

mera fb page: Eccentric Tutorials