🚨 HTML2PDF Deprecated [UPDATE + ALTERNATIVES]

Why are there now 5 tables?
Your issue is error 414 because the content in your template is too long. I have temporarily removed your table 4. Later, you can create it again using the same procedure just to print table.
Try copying the following code to test it first:

<style>
table, #table1, #table2, #table3, #table4, #table5 {font-family: Calibri; width: 100%}

#table1 {border-bottom: 1px solid #ddd;}

#table2 {color: black; border: 1px solid #000;border-collapse: collapse;}
</style>

<h2>BOOM LIFTS INSPECTION REPORT</h2>
<table id="table1">
<tr>
<td>Report No</td>
<td colspan="2">{{reportno}}</td>
<td>Date</td>
<td colspan="2">{{date}}</td>
</tr>
<tr>
<td>Model</td>
<td colspan="2">{{modelno}} {{equipmentid}}</td>
<td>Hour Meter</td>
<td colspan="2">{{hourmeter}}</td>
</tr>
<tr>
<td>Serial No</td>
<td colspan="2">{{serialno}}</td>
<td>Customer</td>
<td colspan="2">{{customer}}</td>
</tr>
<tr>
<td>PMA No</td>
<td colspan="2">{{pmano}}</td>
<td>Site Location</td>
<td colspan="2">{{sitelocation}}</td>
</tr>
<tr>
<td>PMA Cert. Expiry</td>
<td colspan="2">{{pmaexpiry}}</td>
<td>Inspection Type</td>
<td colspan="2">{{inspectiontype}}</td>
</tr>
<tr>
<td>Inspected By</td>
<td colspan="2">{{inspectedby}}</td>
<td>Job Type</td>
<td colspan="2">{{jobtype}}</td>
</tr>
</table>
<p></p>
<p></p>
<table id="table2">
{{table2}}
</table>
<p></p>
<table id="table3">
{{table3}}
</table>
<p></p>
<table id="table5">
<tr>
<th colspan="10">PHOTO</th>
<th colspan="2">RESULTS</th>
</tr>
<tr>
<th colspan="12">TIRE CONDITION</th>
</tr>
<tr>
<td><img class="fit-picture" src="{{PQ1}}" alt="Forward Right" /></td>
<th></th>
</tr>
</tr>
<tr>
<td colspan="1">67</td>
<td colspan="9">Forward Left</td>
<td colspan="2">{{PQ2}}</td>
</tr>
<tr>
<td colspan="1">68</td>
<td colspan="9">Rear Right</td>
<td colspan="2">{{PQ3}}</td>
</tr>
<tr>
<td colspan="1">69</td>
<td colspan="9">Rear Left</td>
<td colspan="2">{{PQ4}}</td>
</tr>
</table>

I added code to count the number of characters so you can monitor your condition.

1 Like

Hi @Loqode!

Am I correct in saying that none of the options work anymore? Seems to have been disabled today / over the weekend.

Do you have any suggestions for hosted alternatives?

Thanks,

1 Like

I’m working on a free plugin for everyone, stay tuned :+1:

The options above should still work, the only one that won’t is probably the dev link.

5 Likes

First off, thanks for putting this together. I have a suggestion for your consideration - making the timeout for the print function a parameter… either in the querystring or as a configurable option in the plug-in (if possible).

Here’s why I’m asking… I recently added an image tag to my template, which passes a deeplink to yet another URL (similar to what you are doing) to generate a qr image from the deeplink passed in the querystring. Often, the image does not appear before the print function kicks off, thus it is not included in the print dialog. I have to click cancel and the second time it works perfectly. Changing the timeout from 500 to something like 1000 should fix this by allowing just enough time for the image to load before kicking off the print function.

I had planned to take your code and self host with the necessary timeout tweak implemented. Just sharing in case you may want to include a configurable timeout in any future enhancements.

Thanks again!

1 Like

Here’s the plugin!

Enjoy! :nerd_face:

2 Likes