Rental Software Tips

Customising Document Templates and PDF Printing

Daniel Shenker

Every equipment rental business relies on clear, branded documentation to keep operations running smoothly. HireHop features a very powerful, highly advanced document creation and editing engine that allows you to generate completely bespoke HTML and PDF documents, including quotes, invoices, delivery notes, purchase orders, pull sheets and equipment labels.

Even though it is incredibly robust, it is simple to use. All documents are written in standard HTML and fully support CSS and JavaScript, even when HireHop converts them into a flat PDF. There are numerous standard templates available out of the box, and every template can be fully customised if you are a paying HireHop subscriber.

Document Types & Rules

A document template will only be available in its appropriate, context-aware location within the software. For example:

  • A Job Quote document will only appear when you are actively inside a job (and not when you are in Stock Management or a Project).
  • A Job Invoice document will only appear when an authorised invoice is selected inside the Billing tab. If the invoice has not yet been authorised, the option to generate the document will remain hidden.

Managing Document Templates

In Settings ➔ Documents, you can add a new template or edit existing layouts:

  • All factory template documents feature a padlock icon on their grid row. If you edit one of these, HireHop automatically creates a custom copy as a new document.
  • Padlocked template documents are entirely safe to delete because they can easily be re-added from the factory library at any time.
  • Documents without a padlock icon are your unique, custom templates. These cannot be retrieved once deleted, so it is highly advised to keep regular external backups of your custom code.

Editing and Using Merge Fields

While HireHop includes a basic built-in HTML editor, it is highly recommended to use the “Source” code view as much as possible for precise control.

HireHop templates utilise dynamic merge fields that are automatically pre-filled with live data when you print, download, or email a paperwork file.

The full list of available data fields and a comprehensive explanation on how to use them can be found in the official HireHop Merge Fields Reference Guide.

Interfacing With the HireHop API & Custom Scripts

Instead of (or in addition to) using standard merge fields, documents inside HireHop can talk directly with the HireHop API to pull raw data straight from the server. (Please note: for security reasons, this live API fetching will not function on shared document links sent to clients.)

HireHop documents can communicate with third-party APIs and even load and utilise robust JavaScript frameworks. As an example of a document getting its data using the API, you can copy the code from the template at https://myhirehop.com/docs/job_info.html and paste it directly into a job document. The raw output is a complete data dump received straight from the server.

You can also use a document to POST (send) data back to the system, which is exactly how HireHop’s signature request feature works.

Automated Archiving Script Example

For example, if you print or email a quote document, adding the custom script below into your quote template will automatically create an archive entry every single time that document is opened in a new tab, downloaded, or sent as a PDF:

<script>
	// Save the supplying list as a quote once the document has finished loading
	window.onload = function() {
		var http = new XMLHttpRequest(),
		    job_id = document.getElementById("number").textContent,
		    now_str = (new Date()).toLocaleDateString(),
		    params = "job=" + job_id + "&desc=" + encodeURIComponent("Quote sent - " + now_str);
		http.open("POST", "/php_functions/archive_insert.php");
		http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		http.send(params);
	}
</script>

Rendering PDFs & Selecting Your Engine

HireHop uses two separate rendering engines to translate HTML documents into crisp PDFs:

  • Chromium: The modern engine used by Google Chrome and Microsoft Edge. It supports modern HTML5 and advanced layout rules flawlessly.
  • WebKit: The legacy engine that forms the base of Apple Safari.

While WebKit is older, it is significantly faster at generating PDF documents due to its simplicity. If your document layouts render and look correct using WebKit, it is highly advised to use it to optimise your processing speed.

Adding Digital Document Stationery

When printing or emailing PDF files, you can upload digital letterheads or background stationery that your document text will automatically overlay onto.

  • Stationery files are uploaded as standard PDFs inside Depot Management, meaning you can have unique branding and contact details automatically adjust for each individual depot (including virtual depots).
  • The layout engine adds stationery pages sequentially to match your document. If your template runs longer than your stationery file, the last page of your stationery PDF will automatically repeat for all remaining document pages.
  • Example: Uploading a single-page background PDF will place that exact image behind every page of your printout. Uploading a 2-page stationery PDF will place page 1 behind your first sheet, and page 2 behind sheet two and every subsequent page that follows.

Need Help with Your Document Layouts?

Having professionally branded, clear documents is essential for setting the right impression with your clients. HireHop’s flexible document customisation allows you to tailor your layouts to match your exact brand guidelines.

If you are ready to update your templates, you can log into HireHop to edit your documents in your settings. If you need a hand setting up a complex HTML layout or migrating a specific design, please reach out to our support team who will be happy to assist you.

DS
Author

Daniel Shenker