Print Designer

Print Designer is used to maintain / modify print templates used by transactions, such as receipts, invoices, notes, and other printed documents.

Menu Route

Settings Designer & Menu

/printdesigner

When to Use

  • When a print format needs to be adjusted, for example adding logo, changing title, arranging columns, or changing paper size.
  • When implementors need template variations without changing the main application.
  • When an old design should be duplicated before editing.
  • When templates need to be moved between servers using JSON export and import.

Basic Concepts

  • Print File is the print design selected from the server.
  • Name is a friendly template name.
  • Group Design is the design code/path called by other forms. Do not change it carelessly when already used.
  • Template is HTML/EJS. HTML controls layout; EJS reads transaction data, loops detail lines, and prints totals.
  • Code is safer for structure and EJS. WYSIWYG is useful for simple visual edits.
  • EJS chip protects EJS code in visual mode so <%= ... %> does not break.
  • Default Page Setup controls paper size, orientation, custom width/height, and margins.

Workflow

  1. Open Settings / Designer & Menu / Print Designer.
  2. Select the Print File to edit.
  3. Click Duplicate before editing an operational template.
  4. Edit Name when needed, but be careful with Group Design.
  5. Use Code for loops, conditions, calculations, and complex tables. Use WYSIWYG for simple text or layout changes.
  6. Set paper size, custom width/height, margins, and orientation.
  7. Click Save to store the design on the server.
  8. Use Save as JSON for backup and Import for templates from another server.

How to Read a Template

  • Normal text in the template is printed as-is.
  • <%= ... %> displays a value such as transaction number, date, customer, or total.
  • <% ... %> is logic such as if, for, subtotal calculation, or variable preparation.
  • Tables usually contain a header row and a detail row. Repeated detail rows are usually controlled by an EJS loop.
  • Use Code mode when the template contains many conditions and loops.

Top Buttons

Button Use
Refresh Reload the print file list from the server.
Import Load a JSON design file from the computer.
Duplicate Create a copy of the selected design before editing.
Save Save the current design to the server.
Save as JSON Download the design as JSON for backup or migration.
Delete Delete the design file after confirmation.

Default Page Setup

Setting Explanation
Paper Size Standard paper size or custom size for the printout.
Orientation Portrait or landscape. Use landscape for wide tables.
Custom Width / Height Useful for thermal printers and special paper.
Margins Controls left, right, top, and bottom spacing.
Active Marks whether the template should still be used.

EJS Chips in WYSIWYG Mode

  • EJS chips protect template code while users edit visually.
  • Click Edit on a chip to change the EJS expression.
  • Use Code mode when the chip represents loops, conditions, or calculations.
  • After visual editing, preview or print a sample document before using it operationally.

Modify Design with AI

The Modify design with AI panel helps change a design without writing code yourself. It is available to users whose role has Allow AI, and it uses the same credit balance as the AI Assistant.

  1. Select the design to change, then describe what you need in Requested changes. Example: fit the receipt to 80 mm paper, enlarge the company name, and add a signature area.
  2. Click Propose changes. AI shows a summary and a comparison of Before and AI proposal; the credits used and the remaining balance are shown too.
  3. Click Apply to editor if the proposal fits, or Dismiss proposal if not. Applying or discarding a proposal uses no further credits.
  4. Check the result in the editor, then save with the designer's usual save button. Undo AI changes restores the design from before it was applied, as long as no other edit has been made.
AI only receives the design source, never transaction data. Instructions are limited to 4,000 characters and the design to about 120 KB. SQL from AI is accepted only if it is a read-only query, and EJS templates are syntax-checked before they can be applied. File name, path, active status, and public status cannot be changed by AI. Always test the AI result with Preview before using it.

Things to Check

  • Export JSON or Duplicate before changing a template used in operations.
  • Small EJS mistakes can make printing fail.
  • If output is too wide or cut off, check paper size, orientation, and margins.
  • If transaction data does not appear, check EJS field names.
  • Delete only templates that are no longer used by active transactions.