Live demos

Enable JavaScript to use the live demos.

Your browser is too old for this page. Please use the latest Chrome, Edge, Firefox, or Safari.

Browse the sample list on the left and preview layouts plus sample code on the right. Run a demo to print silently or preview PDF via web-print-pdf and the local client. Install and launch the client first.

Client

If results look wrong, install the latest Web Print Expert client from our site first (older builds may cause layout drift).

Layout

Preview and print follow standard HTML/CSS only—no hidden tricks. What you style is what you get.

17 - Price tag (green)

Green supermarket price tag (100×35mm): product name, origin, retail price, SKU/spec, barcode, special price.

Sample code

const html = `<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>商品标价签(绿)</title>
  <style>
    html, body { margin: 0; padding: 0; }
    .biz-sheet {
      position: relative;
      width: 378px;
      height: 132px;
      box-sizing: border-box;
      background: #fff;
      font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
      color: #0F172A;
      overflow: hidden;
    }
  </style>
</head>
<body>
  <div class="biz-sheet">
<div style="position:absolute;left:2px;top:2px;width:374px;height:128px;box-sizing:border-box;overflow:hidden;border:2px solid #5B9E23;box-sizing:border-box"></div>
<div style="position:absolute;left:100px;top:8px;width:178px;height:18px;box-sizing:border-box;overflow:hidden;font-size:13px;font-weight:700;color:#3F7A16;text-align:center;display:flex;align-items:center;justify-content:center;white-space:pre-wrap">商品标价签</div>
<div style="position:absolute;left:2px;top:30px;width:374px;height:1px;box-sizing:border-box;overflow:hidden;background:#5B9E23"></div>
<div style="position:absolute;left:38px;top:33px;width:150px;height:14px;box-sizing:border-box;overflow:hidden;font-size:9px;font-weight:700;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">原味酸奶</div>
<div style="position:absolute;left:230px;top:33px;width:140px;height:14px;box-sizing:border-box;overflow:hidden;font-size:9px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">内蒙古呼和浩特</div>
<div style="position:absolute;left:8px;top:34px;width:26px;height:12px;box-sizing:border-box;overflow:hidden;font-size:7px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">品名</div>
<div style="position:absolute;left:200px;top:34px;width:26px;height:12px;box-sizing:border-box;overflow:hidden;font-size:7px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">产地</div>
<div style="position:absolute;left:2px;top:50px;width:374px;height:1px;box-sizing:border-box;overflow:hidden;background:#5B9E23"></div>
<div style="position:absolute;left:168px;top:53px;width:54px;height:14px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">B-2026-088</div>
<div style="position:absolute;left:258px;top:53px;width:112px;height:14px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">200g / 杯</div>
<div style="position:absolute;left:8px;top:54px;width:60px;height:12px;box-sizing:border-box;overflow:hidden;font-size:8px;font-weight:700;color:#3F7A16;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">零售价</div>
<div style="position:absolute;left:136px;top:54px;width:30px;height:12px;box-sizing:border-box;overflow:hidden;font-size:7px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">货号</div>
<div style="position:absolute;left:230px;top:54px;width:26px;height:12px;box-sizing:border-box;overflow:hidden;font-size:7px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">规格</div>
<div style="position:absolute;left:8px;top:68px;width:120px;height:50px;box-sizing:border-box;overflow:hidden;background:#FFE100;border:1px solid #5B9E23;box-sizing:border-box"></div>
<div style="position:absolute;left:134px;top:70px;width:240px;height:1px;box-sizing:border-box;overflow:hidden;background:#5B9E23"></div>
<div style="position:absolute;left:12px;top:74px;width:92px;height:30px;box-sizing:border-box;overflow:hidden;font-size:20px;font-weight:700;color:#3F7A16;text-align:right;display:flex;align-items:center;justify-content:flex-end;white-space:pre-wrap">12.80</div>
<div style="position:absolute;left:136px;top:74px;width:50px;height:10px;box-sizing:border-box;overflow:hidden;font-size:7px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">商品条码</div>
<div style="position:absolute;left:136px;top:84px;width:236px;height:26px;box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="236" height="24" viewBox="0 0 236 24" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><rect x="0" y="0" width="1" height="24" fill="#111"/><rect x="2" y="0" width="1" height="24" fill="#111"/><rect x="5" y="0" width="3" height="24" fill="#111"/><rect x="9" y="0" width="2" height="24" fill="#111"/><rect x="14" y="0" width="1" height="24" fill="#111"/><rect x="17" y="0" width="3" height="24" fill="#111"/><rect x="21" y="0" width="3" height="24" fill="#111"/><rect x="25" y="0" width="1" height="24" fill="#111"/><rect x="27" y="0" width="2" height="24" fill="#111"/><rect x="32" y="0" width="1" height="24" fill="#111"/><rect x="35" y="0" width="3" height="24" fill="#111"/><rect x="39" y="0" width="2" height="24" fill="#111"/><rect x="44" y="0" width="1" height="24" fill="#111"/><rect x="48" y="0" width="1" height="24" fill="#111"/><rect x="50" y="0" width="1" height="24" fill="#111"/><rect x="53" y="0" width="3" height="24" fill="#111"/><rect x="57" y="0" width="2" height="24" fill="#111"/><rect x="62" y="0" width="1" height="24" fill="#111"/><rect x="65" y="0" width="3" height="24" fill="#111"/><rect x="69" y="0" width="3" height="24" fill="#111"/><rect x="73" y="0" width="1" height="24" fill="#111"/><rect x="75" y="0" width="2" height="24" fill="#111"/><rect x="80" y="0" width="1" height="24" fill="#111"/><rect x="83" y="0" width="3" height="24" fill="#111"/><rect x="87" y="0" width="2" height="24" fill="#111"/><rect x="92" y="0" width="1" height="24" fill="#111"/><rect x="96" y="0" width="1" height="24" fill="#111"/><rect x="98" y="0" width="1" height="24" fill="#111"/><rect x="101" y="0" width="3" height="24" fill="#111"/><rect x="105" y="0" width="2" height="2
// …

Result

  • If printing fails or the client cannot connect, see Local print works—production does not? (common on HTTP deployments).
  • The client’s built-in Run examples page has more editable demos; this page complements it.
  • Utility demos (connection, printer list) return JSON only—no print job.
Download client free View npm package