Results 1 to 8 of 8

Thread: PHP to PDF-Class 1 introduction

  1. #1
    ali_num13 is offline Senior Member+
    Last Online
    9th August 2016 @ 07:28 PM
    Join Date
    29 Dec 2012
    Gender
    Male
    Posts
    199
    Threads
    102
    Credits
    1,008
    Thanked
    8

    Lightbulb PHP to PDF-Class 1 introduction

    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

  2. #2
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 02:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    102
    Credits
    22,803
    Thanked
    955

    Default

    وعلیکم السلام
    -----
    بہت شکریہ کہ آپ نے اپنی علم ہمارے ساتھ شئیر کیا
    ------
    اگر یہ اردو زبان میں ہوتا تو بہت اچھی بات ہوتی
    ------
    دوسرا یہ کہ اتنا لمبا چوڑا طریقہ کار اپنانے سے بہتر نہیں ہے کہ ہم
    پی ڈی ایف کریئٹر استعمال مراد انسٹال کر لیں
    جو کہ فری بھی ہے
    اور استعمال میں آسان بھی
    -------
    یا
    آپ دونوں کے فرق کو واضح فرما دیں
    شکریہ

  3. #3
    Afridi47's Avatar
    Afridi47 is offline Advance Member
    Last Online
    17th December 2017 @ 08:39 PM
    Join Date
    31 Mar 2009
    Gender
    Male
    Posts
    1,260
    Threads
    0
    Credits
    2,183
    Thanked
    53

    Default

    Nice sharing bro or Asifsattarvi bro mai apki bat se b agree hon

  4. #4
    ali_num13 is offline Senior Member+
    Last Online
    9th August 2016 @ 07:28 PM
    Join Date
    29 Dec 2012
    Gender
    Male
    Posts
    199
    Threads
    102
    Credits
    1,008
    Thanked
    8

    Default

    Jnab bht shukriya. Actually pdf converter use hota hy us jgah jb apky pas koi document ho bna hua jesay k ms word ka document or apny convert krna ho pdf may. Lekin yahn hum from scratch he pdf bna rahy hain php ko use kar k.
    Yahn ap esa consider kr sakty hain k aapny user say input leni hy or jo wo input dega aap uski pdf bna k user ko de do gay. To yahn aap php ko use kar k pdf bnaty hain jis k lye yea tariqa use hota hy.

    Lamba sirf maximum explain karny ki vja say ho gya hy… sirf first class he long hy baqi sab choti hain q k yea basic hy. Hope so apko ach alga hoga

  5. #5
    mshobi's Avatar
    mshobi is offline Senior Member+
    Last Online
    4th November 2017 @ 01:45 PM
    Join Date
    30 Nov 2010
    Location
    Karachi
    Gender
    Male
    Posts
    349
    Threads
    9
    Credits
    1,420
    Thanked
    8

    Default

    nice sharing

  6. #6
    Redrain is offline Junior Member
    Last Online
    16th March 2016 @ 11:28 PM
    Join Date
    13 Mar 2016
    Age
    31
    Gender
    Male
    Posts
    15
    Threads
    1
    Credits
    146
    Thanked: 1

    Default

    Nice Tutorial Kafi din say main issay search ker raha tha

  7. The Following User Says Thank You to Redrain For This Useful Post:

    ali_num13 (14th March 2016)

  8. #7
    ali_num13 is offline Senior Member+
    Last Online
    9th August 2016 @ 07:28 PM
    Join Date
    29 Dec 2012
    Gender
    Male
    Posts
    199
    Threads
    102
    Credits
    1,008
    Thanked
    8

    Default

    thank you janab ap sath sath follow karty jaein INSHAHALLAH faida hoga

  9. #8
    Umarkhan147's Avatar
    Umarkhan147 is offline Advance Member
    Last Online
    6th October 2017 @ 10:59 AM
    Join Date
    22 Dec 2015
    Location
    Faisalabad
    Age
    22
    Gender
    Male
    Posts
    4,869
    Threads
    231
    Credits
    31,357
    Thanked
    300

    Default

    Bhot Achi Sharing

Similar Threads

  1. PHP to PDF-Class 1 introduction
    By ali_num13 in forum General Discussion
    Replies: 3
    Last Post: 14th April 2016, 07:56 AM
  2. PHP to PDF-Class 1 introduction
    By ali_num13 in forum Courses
    Replies: 4
    Last Post: 26th February 2016, 01:00 AM
  3. PHP to PDF-Class 1 introduction
    By ali_num13 in forum Computer Articles
    Replies: 2
    Last Post: 25th February 2016, 07:28 PM
  4. Internet Class 1 (Introduction)
    By iRFAnSajiD in forum Courses
    Replies: 36
    Last Post: 17th June 2012, 08:12 AM
  5. Internet Class 1 Introduction
    By adnandani93 in forum Courses
    Replies: 12
    Last Post: 17th February 2012, 04:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •