php - PDF generating but corrupted -


i've checked many threads here , tried them out, nothing works. it's generating ms word files not pdf. can tell me quick way generate pdf files.

here's code try :

<?php ob_start(); ?> <style>  #srch-frm {} .srchfld {     font-size: 16px;     height: 31px;     padding: 4px;     width: 162px; } .out-fld {    padding: 11px; } .box_search {} #srch-submit {     font-size: 15px;     height: 34px;     width: 128px; } .township_report {     display:none; } </style>  <div id="wrapper">   <div id="content">  <p>&nbsp;</p>  <div class="srch_report">  <style> #report-headings {     font-size: 20px;     font-weight: bold;     position: relative;     top: -5px;} #report-title {     font-size: 20px;     font-weight: bold;} #report {     background-color: lightgray;     left: 52px;     padding: 32px;     position: relative;     width: 808px;} .hdr {         font-family: verdana;     font-size: 14px;} .hdr-ttl {     padding-left: 39px;} .hdr-date {padding-left: 195px;} .hdr-val {padding-left: 5px;} .fld-ttl {} .fld-val {     float: right;     padding-right: 127px;} .fld-row {     height: 23px;} .fld-col {         float: left;     width: 50%;} #fld-area {     font-size: 16px;} .fld2-val {} .fld2-ttl {     padding-left: 103px;} .fld2 {     font-weight:bold;} .fld2-main {     padding-top: 20px;} .fld2-val-ini {}     </style>  <p>&nbsp;</p> <div id="report">      <div id='report-headings' align="center">         law offices of patrick c. doody     </div>      <div id='report-title'>       <p>township deadlines </p>     </div>      <div class="hdr">          <spam class=''>year:</spam> <spam class='hdr-val'>2006</spam>         <spam class='hdr-ttl'>county:</spam> <spam class='hdr-val'>cook</spam>         <spam class='hdr-ttl'>township:</spam> <spam class='hdr-val'>cook</spam>         <spam class='hdr-date'>as of:</spam> <spam class='hdr-val'>2013-05-14</spam>     </div>  <p>&nbsp;</p>      <div id="fld-area">          <div class="fld-row">             <div class="fld-col">                 <spam class="fld-ttl">assessor open:</spam><spam class="fld-val">2006-03-07</spam>             </div>               <div class="fld-col">                 <spam class="fld-ttl">bofr opens:</spam><spam class="fld-val">2006-09-11</spam>             </div>         </div>          <div class="fld-row">             <div class="fld-col">                 <spam class="fld-ttl">assessor closes:</spam><spam class="fld-val">2006-04-05</spam>             </div>             <div class="fld-col">                 <spam class="fld-ttl">bofr closes:</spam><spam class="fld-val">2006-10-18</spam>             </div>         </div>          <div class="fld-row">             <div class="fld-col">                 <spam class="fld-ttl">assr documents due:</spam><spam class="fld-val">2006-04-20</spam>             </div>             <div class="fld-col">                 <spam class="fld-ttl">bofr hearing:</spam><spam class="fld-val"></spam>             </div>         </div>          <div class="fld-row">             <div class="fld-col">                 <spam class="fld-ttl">assr certified:</spam><spam class="fld-val">2006-05-31</spam>             </div>         </div>      </div> <p>&nbsp;</p> <p>           <table>         <tr>             <td style="width:140px;font-weight:bold;">file #</td>             <td style="width:140px;font-weight:bold;">client</td>             <td style="width:190px;font-weight:bold;">property name</td>             <td style="width:140px;font-weight:bold;">atty</td>         </tr>         <p>           <tr><td>00-5009</td><td>doran</td><td>popeye's chicken</td><td>f&g</td></tr></table>        </p> </div> <p>&nbsp;</p> <style> .prntdiv {     float: left;     padding: 16px 16px 16px 386px;} .savediv {     float: left;     padding: 16px;} #print {     font-family: times new roman;     font-size: 15px;     font-weight: bold;     padding: 6px 15px;} #save {     font-family: times new roman;     font-size: 15px;     font-weight: bold;     padding: 6px 15px;}  </style>  </div> </p> </div> </div> </div> <?php     header('content-type: application/pdf');     header('content-disposition: attachment; filename="report.pdf"');     header('content-transfer-encoding: binary'); ?> 

pdf doesn't work that.

you're creating web page (standard html/css) , telling browser "get if pdf", isn't going work because when browser hands off pdf viewer, not valid pdf file.

you want convert html/css pdf. see: convert html + css pdf php?


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -