Import

Replace the render call

Replace the call that makes the PDF with the Brevier call in two steps, in Java, Python, TypeScript and C#, and keep your data code.

On this page

Community

Your service builds its data and then calls the library that makes the PDF. Replace that call in two steps. The data code stays in both steps. Start with a template from brevier import.

Step 1: keep the data code, change the call

Keep the map or the dictionary of parameters, and pass the list of rows with rows. The template is the one that the import wrote.

return Brevier.template("kontoauszug").with(params).rows(buchungen).render();
return brevier.template("kontoauszug").render(**context, rows=buchungen)
return await Brevier.template("kontoauszug").with(data).rows(buchungen).render();
return Brevier.Template("kontoauszug").With(data).Rows(buchungen).Render();

The parameters map and the dictionary of the old call are the data of this call. For a Word letter, the same call has no rows, for example Brevier.template("mahnung").with(data).render().

Step 2: pass your objects

When step 1 runs, drop the map. The client binds each object to the template root of the same name: a property of Konto or Kunde goes to the root with that name, and the list goes to the root rows.

return Brevier.template("kontoauszug").render(konto, kunde, buchungen);
return brevier.template("kontoauszug").render(konto, kunde, buchungen)
return await Brevier.template("kontoauszug").render({ konto, kunde, buchungen });
return Brevier.Template("kontoauszug").Render(konto, kunde, buchungen);

The engine checks the data against the schema when it renders. The pages of the four clients show how to install them and how to start the engine: Java, Python, TypeScript and C#.