English
Documents
Loop & Roll can produce documents — a certificate, a standard letter, a pre-filled sale agreement — from a Word template filled with the data of a workflow, and transform PDFs: redact personal data for good, merge several PDFs into one, extract pages. It also reads more than plain text: Word files, .zip archives, and scans and photos by text recognition (OCR).
Every document produced is added to the attachments of the run: an Send node further down attaches it like any attachment, an upload node puts it on a drive.
The documents service
Generating PDFs, redacting and OCR run in a separate documents service shared by the instances of a cell (LibreOffice, PDFium and Tesseract). When your instance has one, the four nodes appear in the palette and the template library appears under Templates › Document templates. Without it, they are not offered at all, and reading attachments still works — scans are then reported as “scanned document not read (OCR unavailable)”.
Self-hosting: see Documents service.
The service keeps nothing: each document lives in memory for the length of one job, its logs carry sizes and durations, never content.
The nodes
| Node | What it does |
|---|---|
| Generate a document | Fills a Word template with the workflow data and produces a PDF and/or a .docx. |
| Redact a PDF | Removes for good detected identifiers (social security number, IBAN, card, email, phone) and given terms (names, addresses), from text and scanned PDFs. |
| Merge PDFs | Assembles the PDFs of the run into one file. |
| Split a PDF | Extracts page ranges, or every page, as new files. |
None of them writes outside Loop & Roll: they produce run attachments. They therefore really run during a test run — the test shows the document you will send.
Writing a template
A template is an ordinary Word document (.docx). The fields are written as everywhere else in Loop & Roll — the same paths, the same filters:
- A field:
{{ data.extract.buyer }},{{ email.from.name | upper }},{{ data.extract.price | default:"to be confirmed" }}. A field without a value is left blank and listed in the step data (or fails the step, if you ask for it). - A repeated table row: put
{{#each data.lines}}in the first cell of a row and{{/each}}in its last cell; the row is repeated for each element. Inside,{{ item.label }}is the current element and{{ index }}its rank (1, 2, 3…). - Repeated paragraphs:
{{#each data.lots}}alone in a paragraph, the paragraphs to repeat, then{{/each}}alone in a paragraph. - A condition:
{{#if data.urgent}} … {{else}} … {{/if}}, inline or in their own paragraphs. A value is “true” when it is filled in (non-empty text, non-zero number, non-empty list).{{#if not data.signed}},{{#if data.status == "sold"}}and!=work too.
Word often splits what you type into several pieces internally; Loop & Roll puts each {{ … }} back together, and keeps the formatting of its first character. Typographic quotes typed by Word (“sold”) are read as straight quotes.
A template is checked when it is uploaded: an {{#each}} that is never closed, two blocks that cross each other, a condition that cannot be read are refused with their reason — not discovered at the first run. The library shows the fields detected in each template, to check what it expects before wiring the node.
Redacting for good
A black box drawn over text leaves the text in the file: it can still be selected, copied, extracted. Redact a PDF does not do that. A page that carries at least one occurrence is rendered as an image, the areas are painted in the image, and the page is rebuilt from that image alone: the original text, fonts and content no longer exist in the file. The rebuilt page gets an invisible text layer by OCR of the already redacted image, so the document stays searchable — and what was masked cannot be in it.
Pages without any occurrence are copied as they are. On every page, annotations (comments, links, form fields) are removed, and nothing of the original document's metadata, bookmarks, embedded files or scripts is kept.
The identifiers are detected by the same rules as the sensitive data filter, and validated (NIR key, IBAN checksum, card Luhn): a 16-digit order number is not masked by mistake. Names and addresses are given as terms — often the output of an Extract node upstream.
Reading scans, photos, Word and archives
Read attachments reads PDF, text, HTML and Word; it opens .zip archives and turns their files into run attachments (with safety limits against decompression bombs and booby-trapped paths); and, with a documents service, it reads scans and photos (JPEG, PNG, TIFF, WebP, BMP, GIF, scanned PDFs) by OCR, in French and English.
Limits
- Templates: 10 MB. Documents sent to the service: 25 MB. Redaction and OCR: 100 pages per PDF. Merge: 20 PDFs. Page-by-page split: 100 files.
- Redacted pages become images (200 dpi): their vector quality and links are lost; the rest of the document is untouched.
- OCR is good on printed text and clear scans; it is not reliable on handwriting. A term is masked wherever it appears, including inside a longer word (“Dupont” in “Dupontel”): in redaction, over-masking is the only acceptable mistake.
- HEIC photos are not read: export them as JPEG.