# Portwood 3.65.0 authoring and workflow context Use this reference with the data shape from Copy AI Prompt. Ask for the template type, output format, generation entry point, selected fields and relationship aliases. For signing, ask for the roles, audience and delivery route. Use fictional values for examples. Preserve existing bindings on edits. For an HTML task return a complete printable HTML body, with separate Header HTML and Footer HTML when applicable. For a Flow task return a sequence of elements with input and output mappings, fault and pending branches, and a visible completion check. A template carries content. Flow handles navigation, events, and delivery. # Portwood HTML template recipes Use these as small authoring patterns when authoring an HTML template for Salesforce PDF output. Keep the HTML simple, use the exact field API names from the template query, and verify the generated PDF in the target org. For the full renderer rules and reusable LLM prompt, see [HTML and Word layout](template-layout.md). Start with the [one-field letter](../knowledgebase/examples/acceptance/account-letter.html). For a full working example, use the [service schedule](../knowledgebase/examples/acceptance/service-review.html) and its [rendered PDF](../knowledgebase/examples/acceptance/service-review.pdf). ## Two-column header Use a table for side-by-side content. Fixed widths and cell padding are more predictable than flexbox or grid. ```html
|
{Account.Name} {Account.BillingStreet} {Account.BillingCity}, {Account.BillingState} {Account.BillingPostalCode} |
Quote {Name} Prepared {Today:MMMM d, yyyy} {RunningUser.Name} |
| Item | Qty | Price | Total |
|---|---|---|---|
| {#OpportunityLineItems}{Product2.Name} | {Quantity} | {UnitPrice:currency} | {TotalPrice:currency}{/OpportunityLineItems} |
Total: {Amount:currency}
``` For a row number, place `{RowNumber}` inside the loop. For nested child rows, use the relationship names from the query and keep each loop balanced. Do not wrap a whole `{#Special_Terms__c}Special terms: {Special_Terms__c}{:else}Standard terms apply.{/Special_Terms__c}
{!$Label.Payment_Terms}
``` The label uses the running user's Salesforce language. The field used by the conditional and its value must be in the template's selected data. ## Reusable terms and approved fonts Save a reusable section under **Portwood → Assets → Terms & snippets**, then insert the copied tag where it should appear: ```htmlPrepared for {Name}.
` in **HTML source**. Include **Name** in your Account template, then insert the copied snippet tag. For an Account named Alder Works, the PDF reads **Prepared for Alder Works.** Inside a Contacts loop, the same field reads the current Contact’s name when **Contacts → Name** is selected. [Follow the snippet exercise](../../UserGuide.md#shared-content) Use the stable API name of an approved custom font. Copy the exact tag from the Custom Fonts area; do not guess a font key or revision: ```htmlPrepared for {Account.Name}
``` Snippets are body fragments, not complete HTML documents. Add page-wide CSS in the parent template. Test office output separately; recipients may need the font installed in their Office application. ## QR code and barcode Portwood generates these images natively. Use a short, scannable value for printed QR codes. ```html| Order: {OrderNumber} | {*TrackingUrl:qr:150} |
| {*ProductCode:code128:300x80} | |
| {@Signature_Customer:1:Full} | {@Signature_Customer:1:Date} |
`s |
| Solid `background-color` | `linear-gradient(...)`, `radial-gradient(...)` | Pick the dominant color, drop the gradient |
| `padding`, `margin` | `gap` (CSS 3 grid/flex gap) | `padding` on cells, `margin` on blocks |
| Fixed `width`/`height` in `pt`/`in`/`px` | `calc(...)`, CSS variables (`--foo`, `var(--foo)`) | Compute the literal value in your template |
| `font-size` in `pt` | `rem`, `em` based on a non-default root | Pt is most predictable for print |
| `border` — incl. `dashed` and `dotted` | `border-radius`, `box-shadow`, `text-shadow` | Corners stay square; see "Rounded corners" below |
| Hex colours (`#eaf2fb`) | `rgba(...)`, `hsla(...)` | Pre-compute the tint as a flat hex |
| Full-strength colour | `opacity` | Pick a lighter hex instead |
| `:nth-child(even)` for zebra striping | `:has(...)`, `:is(...)`, container queries | nth-child + nth-of-type are supported |
| `
|