Learn about built-in and custom macros for auto text replacement in PDF.co, including usage in integrations and custom data.
/pdf/edit/add
endpoint or the Fill PDF and Add Text and Images to PDF modules in Zapier, Make, and other integrations.
Macros may look like this: {{$$newLine}}
, [[$$newLine]]
, or {{object.property}}
(when referencing custom data from JSON).
$$
prefix.
Available built-in macros:
{{ ... }}
style macros for their own purposes. To avoid conflicts, you can use [[ ... ]]
square brackets instead. Just add the command ##replaceSquareBracketsToCurlyBrackets##
at the beginning of the text (once per text block).
Example
##replaceSquareBracketsToCurlyBrackets##[[macro1]]
{{macro1}}
templateData
property. Then you can use data from this JSON as {{name}}
or {{object.property}}
macros (or as [[name]]
or [[object.property]]
if you enabled square brackets to curly conversion).
templateData
should be escaped (with JSON.stringify(dataObject)
in JS). Escaping means every "
is replaced with \"
(most programming languages do this automatically).Example
PayloadExample
Payload