Disclaimer: know nothing about mPDF :(
I'm creating a PDF file using mPDF, I've manage to get the table printed successfully. I'm having some issues when it comes to getting my checkboxs checked. The checkboxes does not get checked in PDF view, but if I view the same code in HTML it does get checked. for instance
$output .= '<td width="50%" colspan="2">';
$output .= '<strong>Instructed Another Solicito?</strong> ';
$output .= 'Yes <input type="checkbox" checked /> ';
$output .= 'No <input type="checkbox" />';
$output .= '</td>';
If I view them in HTML echo $output;
format yes is checked but as soon as I output a pdf file i.e. $mpdf->WriteHTML($html); $mpdf->Output();
show as unchecked.
What do I have to do in order to get my checkboxes checked is there any other way to get this
Any Idea?
You should use checked="checked"
For those that fell onto this wanting to print a tick symbol, or use the standard symbols at all, read this documentation.
Essentially there are standard fonts that aren't embedded in the document, as they are included in all PDF readers. This is used by default by mPDF, as it creates the smallest documents with the least processing time. These fonts don't include all but the essential symbols, so no tick symbol etc.
However, you can get mPDF to embed a "full" font quite easily, for instance to print a tick:
<p style='font-family:helvetica'>✔</p>
Other standard fonts are available if you look in the docs :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With