Skip to main content

Document template modifiers

In this article, we'll explain what types of modifiers can be used for document templates and how they work

Uspacy Support Team avatar
Written by Uspacy Support Team
Updated over a week ago

Modifiers are special notations that allow you to flexibly control how data is displayed in your document templates (e.g., in contracts, invoices, etc.).

Currently, in Uspacy, you can use the following ⬇️

Modifiers for amount (Money field)

~words

💡If it is necessary that the price of the products, their total amount or the amount of the deal, etc. (that is, any field of the type Money) should be entered in the form of the text, then the part ~words should be added to the character code.

Let’s consider the example of the Deal amount field. To display the deal amount by using the text form in the document, you need to enter the character code in the template as follows:

Deal Amount:

${DealsAmountOfTheDeal~words}

☝🏻 A quick note: cents ( depending on the currency) will always appear as a number in the word-based display. If they aren't specified, they'll still be written as "00 cents".

If you need both a numerical and text form, then you can enter it like this:

Deal Amount: ${DealsAmountOfTheDeal}

(${DealsAmountOfTheDeal~words})

~amount та ~currency

Additionally, to display only the numeric value in the document, you need to write the character code in the template like this:

Deal amount:
${DealsAmountOfTheDeal~amount}

To display only the currency, it should look like this:

${DealsAmountOfTheDeal~currency}

In other words, to control the appearance of a Money field in document templates, you need to use the following modifiers:

✔️ ~words

✔️ ~amount

✔️ ~currency

Modifiers for image size (Image field)

If you want the image in your generated document to have a specific size, use modifiers to specify the height and width (in pixels).

These are added to the character code of the field in the format: :X:Y

Where:

  • X = width

  • Y = height

For example, if the character code of the field without modifiers looks like this:

${DealsSignatureOfTheResponsiblePerson}

Then with modifiers it would be:

${DealsSignatureOfTheResponsiblePerson:100:75}

If you have additional questions or you need to contact the support, send a request to this email [email protected]

Did this answer your question?