How to generate the PDF Using PHP

  Databases

Email

  1. Design the HTML Page PDF  exple: like
  2. <page style=”font-size: 14px”><div style=”height: 1000px”>

    <table width=”100%” align=”center” cellpadding=”0″ cellspacing=”0″ style=”padding: 0 ;margin: 0; “>

    <tr valign=”top”>
    <td width=”100%”><img src=”res/images/mts_main.jpg” alt=”” style=”width:100%;height: 624px;display: block” /> </td>

    </tr>

    <tr>
    <td style=”height:75px;width:100%;background-color:rgb(247, 150, 71); “>

    </td>
    </tr>
    </table>

    </div>
    </page>

  3. Php using Fetching the all html page exple:
  4. $pageContent_as = file_get_contents(‘template/index_as.html’,true);
    $page1Content_as = file_get_contents(‘template/index1_as.html’,true);
    $page2Content_as = file_get_contents(‘template/index1_about.html’,true);
    $page3Content_as = file_get_contents(‘template/index2_about.html’,true);
  5. fetching the values all html : exple
  6. $days = getDaysForGCQuote($auto_id_sales_opportunity);
    $price = getPriceForGCQuote($auto_id_sales_opportunity);
  7. send value to   html page like : $pageContent_as = str_replace(array(‘##Designation##’), array($contactPerson[1]), $pageContent_as);
    $pageContent_as = str_replace(array(‘##Email##’), array($contactPerson[2]), $pageContent_as);
    $pageContent_as = str_replace(array(‘##Mob##’), array($contactPerson[4]), $pageContent_as);
Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of