Receipts

Compact POS Receipt Template

Narrow thermal receipt layout with store header, itemized rows, totals, barcode, and footer.

pos-receiptthermalretailreceiptbarcode

Template JSON

rev_20260529_v2_receipt_pos
{
  "schema": {
    "fields": [
      {
        "key": "store_name",
        "type": "string",
        "required": true,
        "label": "Store name",
        "default_value": "GPDF STORE"
      },
      {
        "key": "store_line",
        "type": "string",
        "required": true,
        "label": "Store line",
        "default_value": "210 Market Street, San Francisco, CA"
      },
      {
        "key": "receipt_number",
        "type": "string",
        "required": true,
        "label": "Receipt number",
        "default_value": "RCT-2026-0529"
      },
      {
        "key": "receipt_date",
        "type": "string",
        "required": true,
        "label": "Receipt date",
        "default_value": "2026-05-29 14:35"
      },
      {
        "key": "subtotal",
        "type": "string",
        "required": true,
        "label": "Subtotal",
        "default_value": "$62.50"
      },
      {
        "key": "tax",
        "type": "string",
        "required": true,
        "label": "Tax",
        "default_value": "$5.16"
      },
      {
        "key": "total",
        "type": "string",
        "required": true,
        "label": "Total",
        "default_value": "$67.66"
      },
      {
        "key": "barcode_payload",
        "type": "string",
        "required": true,
        "label": "Barcode payload",
        "default_value": "RCT-2026-0529"
      },
      {
        "key": "footer_text",
        "type": "string",
        "required": true,
        "label": "Footer",
        "default_value": "Thank you. This receipt was generated by gPdf."
      },
      {
        "key": "items",
        "type": "array",
        "required": true,
        "label": "Items",
        "items": [
          {
            "key": "name",
            "type": "string",
            "required": true,
            "label": "Item",
            "default_value": "PDF render credits"
          },
          {
            "key": "qty",
            "type": "number",
            "required": true,
            "label": "Qty",
            "default_value": 1
          },
          {
            "key": "unit",
            "type": "string",
            "required": true,
            "label": "Unit",
            "default_value": "$20.00"
          },
          {
            "key": "amount",
            "type": "string",
            "required": true,
            "label": "Amount",
            "default_value": "$20.00"
          }
        ]
      }
    ]
  },
  "layout": {
    "pages": [
      {
        "width": 80,
        "height": 180,
        "elements": [
          {
            "type": "rect",
            "x": 0,
            "y": 0,
            "width": 80,
            "height": 180,
            "z_index": 0,
            "fill": {
              "color": "#FFFFFF",
              "opacity": 1
            }
          },
          {
            "type": "text",
            "x": 8,
            "y": 12,
            "frame": {
              "width": 64
            },
            "content": {
              "blocks": [
                {
                  "type": "paragraph",
                  "inlines": [
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "store_name",
                      "style": {
                        "font_weight": "bold"
                      }
                    }
                  ]
                }
              ]
            },
            "defaults": {
              "paragraph": {
                "line_height": 1.18,
                "align": "center"
              },
              "run": {
                "font_family": "NotoSans-Regular",
                "font_mode": "prefer",
                "font_size": 10,
                "color": "#111827",
                "font_weight": "bold"
              }
            },
            "z_index": 0
          },
          {
            "type": "text",
            "x": 8,
            "y": 25,
            "frame": {
              "width": 64
            },
            "content": {
              "blocks": [
                {
                  "type": "paragraph",
                  "inlines": [
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "store_line"
                    }
                  ]
                }
              ]
            },
            "defaults": {
              "paragraph": {
                "line_height": 1.18,
                "align": "center"
              },
              "run": {
                "font_family": "NotoSans-Regular",
                "font_mode": "prefer",
                "font_size": 4.8,
                "color": "#6B7280"
              }
            },
            "z_index": 0
          },
          {
            "type": "line",
            "x1": 8,
            "y1": 42,
            "x2": 72,
            "y2": 42,
            "stroke": {
              "color": "#9CA3AF",
              "width": 0.2
            },
            "z_index": 0
          },
          {
            "type": "text",
            "x": 8,
            "y": 48,
            "frame": {
              "width": 28
            },
            "content": {
              "blocks": [
                {
                  "type": "paragraph",
                  "inlines": [
                    {
                      "type": "text",
                      "text": "Receipt"
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "receipt_number"
                    }
                  ]
                }
              ]
            },
            "defaults": {
              "paragraph": {
                "line_height": 1.18
              },
              "run": {
                "font_family": "NotoSans-Regular",
                "font_mode": "prefer",
                "font_size": 5.5,
                "color": "#374151"
              }
            },
            "z_index": 0
          },
          {
            "type": "text",
            "x": 44,
            "y": 48,
            "frame": {
              "width": 28
            },
            "content": {
              "blocks": [
                {
                  "type": "paragraph",
                  "inlines": [
                    {
                      "type": "text",
                      "text": "Date"
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "receipt_date"
                    }
                  ]
                }
              ]
            },
            "defaults": {
              "paragraph": {
                "line_height": 1.18,
                "align": "right"
              },
              "run": {
                "font_family": "NotoSans-Regular",
                "font_mode": "prefer",
                "font_size": 5.5,
                "color": "#374151"
              }
            },
            "z_index": 0
          },
          {
            "type": "table",
            "x": 8,
            "y": 70,
            "width": 64,
            "columns": [
              {
                "key": "name",
                "header": "Item",
                "width": {
                  "mode": "fixed",
                  "value": 30
                }
              },
              {
                "key": "qty",
                "header": "Q",
                "width": {
                  "mode": "fixed",
                  "value": 8
                },
                "cell": {
                  "text": {
                    "text_align": "right"
                  }
                },
                "header_cell": {
                  "text": {
                    "text_align": "right"
                  }
                }
              },
              {
                "key": "unit",
                "header": "Unit",
                "width": {
                  "mode": "fixed",
                  "value": 12
                },
                "cell": {
                  "text": {
                    "text_align": "right"
                  }
                },
                "header_cell": {
                  "text": {
                    "text_align": "right"
                  }
                }
              },
              {
                "key": "amount",
                "header": "Amt",
                "width": {
                  "mode": "fixed",
                  "value": 14
                },
                "cell": {
                  "text": {
                    "text_align": "right"
                  }
                },
                "header_cell": {
                  "text": {
                    "text_align": "right"
                  }
                }
              }
            ],
            "rows": "{{#each items}}",
            "header": {
              "show": true,
              "repeat_on_page_break": true,
              "cell": {
                "fill": {
                  "color": "#111827"
                },
                "text": {
                  "color": "#FFFFFF",
                  "font_size": 4.6,
                  "font_weight": "bold"
                }
              }
            },
            "cell": {
              "padding": {
                "x": 0.8,
                "y": 1.2
              },
              "text": {
                "color": "#1F2937",
                "font_size": 4.8
              }
            },
            "grid": {
              "top": {
                "color": "#CBD5E1",
                "width": 0.2
              },
              "bottom": {
                "color": "#CBD5E1",
                "width": 0.2
              },
              "horizontal": {
                "color": "#E5E7EB",
                "width": 0.18
              },
              "left": {
                "color": "#E5E7EB",
                "width": 0.18
              },
              "right": {
                "color": "#E5E7EB",
                "width": 0.18
              }
            },
            "z_index": 0
          },
          {
            "type": "text",
            "x": 40,
            "y": 120,
            "frame": {
              "width": 30
            },
            "content": {
              "blocks": [
                {
                  "type": "paragraph",
                  "inlines": [
                    {
                      "type": "text",
                      "text": "Subtotal "
                    },
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "subtotal"
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "text",
                      "text": "Tax "
                    },
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "tax"
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "text",
                      "text": "Total "
                    },
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "total",
                      "style": {
                        "font_weight": "bold"
                      }
                    }
                  ]
                }
              ]
            },
            "defaults": {
              "paragraph": {
                "line_height": 1.18,
                "align": "right"
              },
              "run": {
                "font_family": "NotoSans-Regular",
                "font_mode": "prefer",
                "font_size": 5.4,
                "color": "#111827",
                "font_weight": "bold"
              }
            },
            "z_index": 0
          },
          {
            "type": "barcode",
            "format": "code128",
            "content": "{{barcode_payload}}",
            "x": 12,
            "y": 142,
            "width": 56,
            "height": 12,
            "barcode_text": {
              "enabled": false,
              "position": "bottom"
            },
            "z_index": 0
          },
          {
            "type": "text",
            "x": 8,
            "y": 162,
            "frame": {
              "width": 64
            },
            "content": {
              "blocks": [
                {
                  "type": "paragraph",
                  "inlines": [
                    {
                      "type": "variable",
                      "scope": "binding",
                      "name": "footer_text"
                    }
                  ]
                }
              ]
            },
            "defaults": {
              "paragraph": {
                "line_height": 1.18,
                "align": "center"
              },
              "run": {
                "font_family": "NotoSans-Regular",
                "font_mode": "prefer",
                "font_size": 4.6,
                "color": "#6B7280"
              }
            },
            "z_index": 0
          }
        ]
      }
    ]
  }
}
Sample data
{
  "store_name": "GPDF STORE",
  "store_line": "210 Market Street, San Francisco, CA",
  "receipt_number": "RCT-2026-0529",
  "receipt_date": "2026-05-29 14:35",
  "subtotal": "$62.50",
  "tax": "$5.16",
  "total": "$67.66",
  "barcode_payload": "RCT-2026-0529",
  "footer_text": "Thank you. This receipt was generated by gPdf.",
  "items": [
    {
      "name": "PDF render credits",
      "qty": 1,
      "unit": "$24.00",
      "amount": "$24.00"
    },
    {
      "name": "Template package",
      "qty": 1,
      "unit": "$18.50",
      "amount": "$18.50"
    },
    {
      "name": "Support window",
      "qty": 1,
      "unit": "$20.00",
      "amount": "$20.00"
    }
  ]
}

Rendered PDF

PDF