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.

18 - Clothing hangtag

Apparel hangtag (54×90mm): brand, name, size/color, care notes, retail price, barcode, wash icons.

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: 204px;
      height: 340px;
      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:6px;top:6px;width:192px;height:328px;box-sizing:border-box;overflow:hidden;border:1px solid #CBD5E1;box-sizing:border-box"></div>
<div style="position:absolute;left:20px;top:18px;width:164px;height:24px;box-sizing:border-box;overflow:hidden;font-size:14px;font-weight:700;color:#0F172A;text-align:center;display:flex;align-items:center;justify-content:center;white-space:pre-wrap">云印服饰</div>
<div style="position:absolute;left:20px;top:44px;width:164px;height:12px;box-sizing:border-box;overflow:hidden;font-size:7px;color:#94A3B8;text-align:center;display:flex;align-items:center;justify-content:center;white-space:pre-wrap">YUANYIN APPAREL</div>
<div style="position:absolute;left:20px;top:64px;width:164px;height:1px;box-sizing:border-box;overflow:hidden;background:#CBD5E1"></div>
<div style="position:absolute;left:20px;top:72px;width:164px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;font-weight:700;color:#0F172A;text-align:center;display:flex;align-items:center;justify-content:center;white-space:pre-wrap">纯棉圆领短袖 T 恤</div>
<div style="position:absolute;left:64px;top:97px;width:120px;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">YY-2610</div>
<div style="position:absolute;left:20px;top:98px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">款号</div>
<div style="position:absolute;left:64px;top:115px;width:120px;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:20px;top:116px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">颜色</div>
<div style="position:absolute;left:64px;top:133px;width:120px;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">L(175/92A)</div>
<div style="position:absolute;left:20px;top:134px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">尺码</div>
<div style="position:absolute;left:64px;top:151px;width:124px;height:32px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#0F172A;white-space:pre-wrap">棉 95%  氨纶 5%</div>
<div style="position:absolute;left:20px;top:152px;width:40px;height:12px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">成分</div>
<div style="position:absolute;left:20px;top:188px;width:164px;height:1px;box-sizing:border-box;overflow:hidden;background:#CBD5E1"></div>
<div style="position:absolute;left:62px;top:190px;width:80px;height:22px;box-sizing:border-box;overflow:hidden;font-size:15px;font-weight:700;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">¥ 199.00</div>
<div style="position:absolute;left:20px;top:194px;width:40px;height:16px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">零售价</div>
<div style="position:absolute;left:20px;top:220px;width:164px;height:46px;box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="164" height="40" viewBox="0 0 164 40" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><rect x="0" y="0" width="3" height="40" fill="#111"/><rect x="6" y="0" width="3" height="40" fill="#111"/><rect x="10" y="0" width="2" height="40" fill="#111"/><rect x="13" y="0" width="2" height="40" fill="#111"/><rect x="18" y="0" width="3" height="40" fill="#111"/><rect x="24" y="0" width="1" height="40" fill="#111"/><rect x="27" y="0" width="1" height="40" fill="#111"/><rect x="30" y="0" width="3" height="40" fill="#111"/><rect x="36" y="0" width="3" height="40" fill="#111"/><rect x="40" y="0" width="2" height="40" fill="#111"/><rect x="43" y="0" width="2" height="40" fill="#111"/><rect x="48" y="0" width="3" height="40" fill="#111"/><rect x="54" y="0" width="1" height="40" fill="#111"/><rect x="57" y="0" width="1" height="40" fill="#111"/><rect x="60" y="0" width="3" height="40" fill="#111"/><rect x="66" y="0" width="3" height="40" fill="#111"/><rect x="70" y="0" width="2" height="40" fill="#111"/><rect x="73" y="0" width="2" height="40" fill="#111"/><rect x="78" y="0" width="3" height="40" fill="#111"/><rect x="84" y="0" width="1" height="40" fill="#111"/><rect x="87" y="0" width="1" height="40" fill="#111"/><rect x="90" y="0" width="3" height="40" fill="#111"/><rect x="96" y="0" width="3" height="40" fill="#111"/><rect x="100" y="0" width="2" height="40" fill="#111"/><rect x="103" y="0" width="2" height="40" fill="#111"/><rect x="108" y="0" width="3" height="40" fill="#111"/><rect x="114" y="0" width="1" height="40" fill="#111"/><rect x="117" y="0" width="1" height="40" fill="#111"/><rect x="120" y="0" width="3" height="40" fill="#111"/><rect x="126" y="0" width="3" height="40" fill="#111"/><rect x="130" y="0" width="2" height="40" fill="#111"/><rect x="133" y="0" width="2" height="40" fill="#
// …

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