Field replace in Jinja template

Greetings to the community,

What is the method to use to replace template fields with form values?
I have a form similar to Terms and Conditions, a field linked to the template doctype that must populate a text editor field.
I can bring the text but it does not replace the fields within the template.
Also, when saving and confirming the form, the sequence or number next to the print icon does not appear.
If someone can tell me where I should adjust I will be very grateful.

Fernando Sánchez