Note that there are some explanatory texts on larger screens.

plurals
  1. POPDF generation with help of php
    text
    copied!<p>I have code that generates PDF for me.I am using FPDF to generate PDF.sometimes it gives out put but sometimes it behaves weirdly and it creates pdf with bad format so it doesnt open in any pdf reader.</p> <p>moreover when it gives me bad format, size of pdf increases dramatically..</p> <p>can anyone suggest what wrong is going with special cases..?</p> <p>here is the code..</p> <pre><code>$pdf_Str = "&lt;table border='1'&gt; &lt;tr bgcolor=\"#666666\"&gt; &lt;td&gt;Name&lt;/td&gt; &lt;td&gt;Number&lt;/td&gt; &lt;td&gt;Adjusted Amount&lt;/td&gt; &lt;td&gt;Invoice Date&lt;/td&gt; &lt;td&gt;Transaction Date&lt;/td&gt; &lt;td&gt;Amount&lt;/td&gt; &lt;td&gt;Balance&lt;/td&gt; &lt;td&gt;Record Type&lt;/td&gt; &lt;td&gt;Session&lt;/td&gt; &lt;td&gt;Course&lt;/td&gt; &lt;/tr&gt;"; foreach($data as $row){ $pdf_Str .="&lt;tr&gt; &lt;td&gt;".$row['student_name']."&lt;/td&gt; &lt;td&gt;".$row['invoiceNumber']."&lt;/td&gt; &lt;td&gt;".$row['invoiceAdjustedAmount']."&lt;/td&gt; &lt;td&gt;".($row['invoiceDate']!=''?$row['invoiceDate']:'&amp;nbsp;')."&lt;/td&gt; &lt;td&gt;".($row['TransactionDate']!=''?$row['TransactionDate']:'&amp;nbsp;')."&lt;/td&gt; &lt;td&gt;".($row['invoiceAmount']!=''?$row['invoiceAmount']:'&amp;nbsp;')."&lt;/td&gt; &lt;td&gt;".($row['invoiceBalance']!=''?$row['invoiceAmount']:'&amp;nbsp;')."&lt;/td&gt; &lt;td&gt;".($row['recordType']!=''?$row['recordType']:'&amp;nbsp;')."&lt;/td&gt; &lt;td&gt;".$row['sessionName']."&lt;/td&gt; &lt;td&gt;".($row['catalogName']!=''?$row['catalogName']:'&amp;nbsp;')."&lt;/td&gt; &lt;/tr&gt;"; } $pdf_Str .='&lt;/table&gt;'; $p = new PDFTable(); $p-&gt;setfont('times','',12); $p-&gt;htmltable($pdf_Str);// $p-&gt;output("student_info.pdf",'I'); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload