How to upload your document template (cover, header and footer)
The document template is the visual wrapper of your documents: cover, repeating header and footer, fonts, colors and logos. The body is still the content you write in WorkOS. It's used in the client portal and in the downloaded PDF.
If you don't upload one, WorkOS uses a neutral design with your logo.
How to upload it
- Go to Settings, find the Documentation card and click Open configurator.
- Go to the Document template step.
- Choose your .zip file and click Upload template. Only the Owner can do it.
The .zip can be up to 10 MB. Uploading a new one replaces the previous one.
What the .zip must contain
A template.html file with three zones marked with these comments: <!-- SDS:COVER --> (cover), <!-- SDS:HEADFOOT --> (header and footer) and <!-- SDS:BODY --> (body, which you leave empty and WorkOS fills in). Each zone is closed with its <!-- /SDS:... --> mark. If any is missing, the upload is rejected and the previous template stays.
You can add styles (.css), images (PNG, JPG, GIF, SVG, WebP) and fonts (WOFF, WOFF2, TTF, OTF). Don't add JavaScript: it's ignored.
Document data
In the cover, header and footer you can use these variables, which WorkOS replaces with the real data:
{{doc.titulo}}, {{doc.fecha}}, {{doc.tipo}}, {{doc.destinatario}} (the Company the document is addressed to), {{doc.proyecto}}, {{doc.valor_bruto}}, {{doc.valor_neto}}, {{doc.valor_mensual_bruto}}, {{doc.valor_mensual_neto}}, {{doc.moneda}}, {{doc.cliente_nombre}} (your company), {{doc.cliente_logo}}, {{doc.fecha_generacion}} and {{doc.ultima_modificacion}}.
If a piece of data isn't configured, it's left empty. To show the page number, include an element with the sds-pagenum class.
The body arrives as simple HTML (headings, paragraphs, lists, tables, images...), so your CSS must style those tags, not classes.
One template per document type
Under Templates by document type you can upload a template of its own for a specific Type. A document of that Type will use its own; the rest keep using the general one.
Tip: it's usually prepared by whoever designs your brand. After uploading it, open a document in the portal and click Download PDF to check the result.