Import

Import a template

Turn a Word file, a JasperReports .jrxml or a BIRT .rptdesign into a Brevier template, and learn which page of this section covers each step.

On this page

Community

brevier import reads a template that you already have and writes the files of a Brevier template. You keep your data code. Only the call that makes the PDF changes.

You have Command The import writes
A Word file with merge fields (.docx) brevier import letter.docx -o templates/letter letter.html, letter.css, letter.schema.json
A JasperReports 6 report (.jrxml) brevier import report.jrxml -o templates/report report.html, report.css, report.schema.json, sample.json
A BIRT report (.rptdesign) brevier import report.rptdesign -o templates/report The same four files
  • Like every command except brevier licence, the import needs a licence key in the environment variable BREVIER_LICENCE_KEY.
  • -o is the folder to write to. Without it, the files go next to the input file. A folder that does not exist is created.
  • The import refuses to replace a file that exists, so a template that you edited is not lost. Add --force to replace it.
  • A .pdf file is accepted, but no file is written: the AcroForm import is planned.
  • The command ends with exit code 0 when it wrote the files. It ends with exit code 1 for an unknown file type, a file that exists, or a file that is not a valid Word, JasperReports or BIRT file. Each case prints a message.

See the result first: the templates page shows the Mahnung (from Word) and the Kontoauszug (from JasperReports) as the PDFs that Brevier renders from the imported files.

The four steps

  1. Import the file. The command writes the template files and prints one line for each element it leaves out: Not converted: line 137: line in the detail band.
  2. Handle what is named. Each named element has a way out that you do by hand. Open the files and check them: the import writes what it can read.
  3. Render and check. Run brevier pdf with the data, then brevier lint to find text that does not fit.
  4. Replace the call. Your service keeps its data code and changes the one call that makes the PDF.

Pages of this section

Page It covers
Example One JasperReports report from the first command to the PDF, with every file shown.
Word The merge fields and template tags that the import reads, and what it does with styles, header and footer.
JasperReports What the import converts and what it names, and the PDF export options.
BIRT What the import reads from a .rptdesign file.
Ways out What you do by hand for each element that the import names.
Replace the call The two steps from your render call to the Brevier call, in Java, Python, TypeScript and C#.