Attachment Designer
Design PDF documents and Excel spreadsheets from templates using the Attachment Designer.
Overview
Create professional PDFs and data-rich Excel files with the same drag-and-drop interface. Perfect for invoices, reports, certificates, and data exports.
Template Types
PDF Templates
- Use for: Invoices, reports, certificates, contracts
- Components: Text, images, tables, charts, dividers
- Output: Professional PDF documents
Excel Templates
- Use for: Data exports, spreadsheets, reports
- Components: Tables, charts, formulas
- Output: Excel .xlsx files with multiple sheets
PDF Designer
Available Components
- Text blocks
- Images and logos (select from Asset Gallery)
- Data tables
- Charts (bar, line, pie, area)
- Dividers and spacers
- Headers and footers
- Page numbers
Page Settings
- Size: A4, Letter, Legal, Custom
- Orientation: Portrait or Landscape
- Margins: Top, bottom, left, right
- Header/Footer: Add to all pages
Excel Designer
Sheet Management
- Create multiple sheets
- Name sheets
- Link between sheets
Components
- Tables: Structured data tables with calculated columns
- Charts: Visual data representation
Calculated Columns
Use JavaScript expressions for calculated values in tables:
row.quantity * row.unitPrice
row.rowNum + 1
row.price > 100 ? 'Premium' : 'Standard'Charts
Available Chart Types
- Bar Chart: Compare values
- Line Chart: Show trends
- Pie Chart: Show proportions
- Area Chart: Cumulative trends
Chart Configuration
- Data source: Link to table or variable
- Colors: Customize chart colors
- Labels: Axis labels and title
- Legend: Show/hide, position
Adding Images to PDFs
From Asset Gallery
- Drag Image component onto PDF canvas
- Click the image component
- In properties panel, click Select from Gallery
- Browse and select an image from your Asset Gallery
- Click Select to insert
- Adjust size and position as needed
Benefits:
- Company logos appear consistently
- Brand assets are centrally managed
- Same asset used across email and PDF templates
- Update once to update everywhere
Upload New Assets
Before designing, upload assets to the gallery:
- Navigate to Asset Gallery
- Click Upload
- Select logos, signatures, or images needed for PDFs
- Organize in folders (e.g., “PDF Assets”, “Signatures”)
Variables in Attachments
Use the same variable system as email templates:
Invoice #{{invoice.number}}
Customer: {{customer.name}}
Total: {{invoice.total}}Variables use double curly braces {{variableName}} syntax and automatically appear in the Variables tab.
Designer Interface
The attachment designer has the same three-panel interface as the email designer:
- Left Panel: Component Library - Drag components from here
- Center Panel: Canvas - Design your PDF/Excel template
- Right Panel: Three tabs for editing
- Properties Tab: Edit selected component settings
- Layers Tab: View and manage component hierarchy
- Variables Tab: See all variables used in the template
Layers Tab (Component Tree)
The Layers tab shows a hierarchical tree view of all components in your attachment template.
Features
Hierarchical View
- All components organized in a tree structure
- Nested components show parent-child relationships
- Special handling for layout components (containers, tables, columns)
Selection Sync
- Click a component in the tree → highlights it on the canvas
- Click a component on the canvas → highlights it in the tree
- Auto-expand and auto-scroll to selected component
Drag & Drop in Tree
- Reorder: Drag components up or down
- Move to container: Drag into different containers
- From library: Drag components directly from library into tree
Right-Click Context Menu
Quick actions available via right-click:
- Duplicate (
Ctrl+D) - Copy component - Delete (
Del) - Remove component - Cut (
Ctrl+X) - Cut to clipboard - Copy (
Ctrl+C) - Copy to clipboard - Paste (
Ctrl+V) - Paste from clipboard - Move Up (
Ctrl+Shift+↑) - Move up in list - Move Down (
Ctrl+Shift+↓) - Move down in list - Wrap in Container (
Ctrl+G) - Wrap in container - Unwrap (
Ctrl+Shift+G) - Remove parent container
Expand/Collapse
- Click arrow to expand/collapse individual components
- Expand All / Collapse All buttons
- Keyboard shortcuts:
Ctrl+]to expand,Ctrl+[to collapse
Use Cases
Complex PDFs: Navigate multi-page documents with many components
Excel Sheets: Manage multiple sheets and their components
Reordering: Quickly reorganize without canvas drag-drop
Variables Tab
The Variables tab automatically tracks all variables used in your attachment template.
Automatic Detection
Variables are automatically extracted from:
- Component content
- Table cells
- Chart data sources
- Conditional logic
- Loop data
Variable Information
Each variable displays:
- Name: Variable identifier
- Type: Auto-detected (String, Number, Boolean, Date, Array, Object)
- Usage Count: Number of times used
- Usage Locations: All places where variable appears
Type Detection
Smart typing based on naming patterns:
- Number: “count”, “total”, “amount”, “price”, “quantity”
- Boolean: “is”, “has”, “enabled”, “active”
- Date: “date”, “time”, “timestamp”
- Array: “items”, “list”, “products”
- Object: “user”, “customer”, “address”
Complex Variables
For arrays and objects, the tab shows:
- Array: Item type and schema
- Object: All properties with types
Grouping
- Variables organized by type
- Collapsible groups with counts
- Filter by type
Navigation
Click any usage location to:
- Navigate to the component
- Highlight it in tree and canvas
- Open properties panel
Keyboard Shortcuts
The attachment designer includes the same keyboard shortcuts as the email designer:
Editing
Ctrl/Cmd + C- Copy componentCtrl/Cmd + X- Cut componentCtrl/Cmd + V- Paste componentCtrl/Cmd + D- Duplicate componentDeleteorBackspace- Delete componentCtrl/Cmd + Z- UndoCtrl/Cmd + Shift + ZorCtrl/Cmd + Y- Redo
Movement
Ctrl/Cmd + Shift + ↑- Move component upCtrl/Cmd + Shift + ↓- Move component down
Grouping
Ctrl/Cmd + G- Wrap in containerCtrl/Cmd + Shift + G- Unwrap container
View
Ctrl/Cmd + [- Collapse all tree nodesCtrl/Cmd + ]- Expand all tree nodes
General
Ctrl/Cmd + S- Save templateShift + ?- Show shortcuts help
Best Practices
PDF Design
- Use consistent fonts and colors
- Include company branding
- Add page numbers for multi-page documents
- Test print output
Excel Design
- Use clear column headers
- Format numbers appropriately
- Add charts for data visualization
- Test formulas with sample data
Generating Attachments
Via API
const response = await fetch('/api/attachments/generate', {
method: 'POST',
body: JSON.stringify({
templateId: 'tmpl_123',
format: 'pdf', // or 'excel'
data: { /* your data */ }
})
});From Dashboard
- Go to Attachment Logs
- Click Generate button
- Select template
- Provide data
- Download result
Related: Email Designer | Templates