Since Memento Database you can export one entry, several selected entries, or a whole library to a PDF file. The export is driven by a report — an HTML template that decides what each page looks like. Memento ships with ready-to-use reports, and you can build your own: choose which fields to show, lay them out as cards or as a table, add a header and footer, and style everything with CSS.
This article explains how to run the export, how to manage reports, and the full template syntax.
Running the export
- Open a library, or open a single entry.
- To export several entries, switch the library to selection mode and select the entries you want. To export the whole library, select all.
- Tap the menu and choose Save as PDF.
- In the dialog, pick a Report from the drop-down (see below).
- Choose the Orientation (Portrait or Landscape).
- Tap Save and choose where to put the file.
The PDF is rendered in the background; a large library may take a few seconds.
The Report drop-down
The Report drop-down combines the rendering engine and the template in one list:
- Legacy (classic) — the classic PDF export. When this is selected the dialog also shows the old Paper size and Scale options. Use it if you relied on the previous behaviour.
- Default (cards) — the new engine, one card per entry, generated automatically from the library’s fields.
- Default (table) — the new engine, all entries in a single table, one row per entry.
- Your saved reports — every report you created for this library is listed here by name.
- Manage reports… — opens the report editor, where you create, edit, duplicate and delete reports.
Your last choice is remembered per library, so the next export starts where you left off.
Managing reports
Open Manage reports… from the Report drop-down (or from the library menu). Here you can:
- Add a report — tap the + button and choose the type:
- Cards — a free-form template, one block per entry. Edited visually or as HTML.
- Table — a single table, one row per entry. Edited as HTML.
- Edit — tap a report to open it in the editor.
- Duplicate — make a copy you can modify without touching the original.
- Delete — remove a report.
Reports are stored on the device and are not synced to the cloud.
The report editor
A report is edited on three tabs:
- Body — the template for a single entry (repeated for every exported entry).
- Header — emitted once at the very top of the document.
- Footer — emitted once at the very bottom.
At the top you set the report Name.
Editor tools
- Insert token — opens a menu of the things you can drop in at the cursor. On the Body tab it lists the library’s fields; on the Header and Footer tabs it lists the document tokens and aggregates (see below).
- Edit source / Visual editor — Cards reports can be edited visually (WYSIWYG) or as raw HTML. Table reports are HTML-only, because a table’s markup would be broken by the visual editor.
- Page per record (Cards only) — when on, every entry starts on a new page; when off, entries flow one after another and a page break happens only when the page fills up.
- Reset to default — replaces the current tab with the auto-generated default for this library.
When you’re done, tap the done / save button in the toolbar.
Template syntax
A template is HTML with placeholders in double braces. The simplest placeholder is a field name:
{{Field Name}} — inserts the value of that field for the current entry.
The field name is exactly the field’s title, spaces and all. If a field is empty, its placeholder renders nothing.
Passing options to a placeholder
Some fields accept options. Options go after a vertical bar |, written as key=value pairs separated by spaces:
{{Field Name | key=value key=value}}
The vertical bar is the separator (field names may contain spaces, so a space can’t be).
Photos
An image field is laid out as a list by default. To arrange photos in a grid, pass mode=grid and the number of columns:
{{Photo | mode=grid cols=3}} — three photos per row.
{{Photo | mode=list}} — one photo per line (the default).
Rich text
A rich-text field keeps its formatting in the PDF automatically — just use {{Field Name}}.
Barcodes and QR codes
A barcode or QR-code field is drawn as the actual scannable code in the report. The format is taken from the field’s settings (QR code, or the barcode type you configured); for a plain barcode field with no fixed format, it is chosen from the value.
The mode option controls what is shown:
{{Code}} — the generated barcode / QR image (the default).
{{Code | mode=text}} — the raw value as text, with no image.
{{Code | mode=image+text}} — the image with the value printed underneath, as on a product label.
An NFC field has no drawable code, so it always prints its value as text. If a value can’t be encoded in the chosen format, the report falls back to the plain value as well.
Document tokens (header & footer)
In the Header and Footer, @-prefixed tokens resolve against the whole document rather than a single entry:
{{@LibraryName}} — the library’s name.
{{@Date}} — today’s date.
{{@RecordCount}} — how many entries are in the report.
The @ keeps these separate from fields, so a library may have a field literally named “Date” without any conflict.
Aggregates
You can show a total, average, etc. of a numeric field over all exported entries:
{{@sum:Price}} — the sum of the Price field.
{{@avg:Rating}} — the average Rating.
{{@min:Price}} , {{@max:Price}} — the minimum / maximum.
The token is {{@<function>:<Field Name>}}. If the library already has this aggregation configured for the field (with its caption and number format), the report reuses it so the result matches the library exactly; otherwise the bare value is computed on the fly. The Insert token menu lists the functions each field supports.
Fields that link to another entry
A “link to entry” field normally prints the titles of the linked entries. You can show their fields in detail.
Detailed block
Pass fields= with a comma-separated list of the linked library’s field names:
{{Actors | fields=Name,Role}} — a mini-card per linked entry, showing those fields.
{{Actors | fields=Name,Role mode=table}} — the same as a table, columns = fields, one row per linked entry.
Without fields=, the placeholder keeps the default behaviour (a comma-separated list of titles).
A single linked value (dotted access)
To pull one field out of the linked entries into the running text, use a dot — the same idea as in the formula engine:
{{Actors.Name}} — the Name of every linked entry, joined together.
{{Actors.Name | index=0}} — the Name of the first linked entry only (0 = first, 1 = second, …).
{{Actors.Name | separator=”; “}} — choose the separator between values (default is a comma and a space).
Only the linked entry’s own fields are reachable (one level deep).
Related entries from other libraries (back-references)
If entries in other libraries link to the current entry (for example a Movies library whose entries point at a Directors library), you can print those incoming entries on each card.
{{@related Library Name}} — a table of the entries from Library Name that link to the current entry.
{{@related Library Name | fields=Title,Year}} — choose which columns to show.
Without fields=, the table shows the fields that make up the linked library’s card (the title, hint, status and icon fields).
When you create a new Cards report, a {{@related …}} block is added automatically for every library that links back — you can keep, move, or delete it like any other part of the template. Back-references are available in Cards reports only.
For performance, all back-references for the whole export are loaded once up front, so a report over hundreds of entries stays fast.
The Table report
A Table report is a single HTML <table>. Its structure is:
- a static header row (<thead>) with the column titles, and
- exactly one marker row — <tr class=”row”>…</tr> — inside the <tbody>.
The marker row is the template for a single entry: it is repeated once per exported entry, with its {{Field}} placeholders expanded each time. Everything outside the marker row (the head, the surrounding <table>) is emitted once.
To remove a column, delete its <th> from the head and its <td> from the marker row. To add a column, add a <th> and a <td>{{Field}}</td>. Styling is done with CSS.
A minimal Table template looks like this:
<table class="records">
<thead>
<tr>
<th>Title</th>
<th>Year</th>
</tr>
</thead>
<tbody>
<tr class="row">
<td>{{Title}}</td>
<td>{{Year}}</td>
</tr>
</tbody>
</table>
The table header repeats on every page automatically.
Styling with CSS
The report carries its own styling. In a Cards report you can wrap fields in your own HTML and class names and style them; the built-in classes (.card, .field, .label, .value, .photos, .barcode, .related, .related-records) are available to override. Sizes are best given in millimetres (mm) so they print predictably.
Some useful patterns:
- Keep a block from being split across a page: break-inside: avoid;
- Force a page break after a block: break-after: page;
Tips
- Empty fields print nothing, so a card never shows a blank label with no value.
- A backslash escapes a brace if you ever need a literal {{ in the output: \{{not a placeholder}}.
- Use Reset to default on any tab to get a clean starting point generated from your current library schema, then trim it down.
- Start from Default (cards) or Default (table), duplicate it via Manage reports…, and edit the copy — that’s the quickest way to a custom report.