Live demos
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.
59 - Prescription
A4 prescription pad: patient, Rx lines, doctor sign-off, and pharmacy fields.
Layout preview
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: 794px;
height: 1123px;
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:48px;top:52px;width:420px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;font-weight:700;color:#0F766E;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">市第一人民医院</div>
<div style="position:absolute;left:546px;top:52px;width:200px;height:66px;box-sizing:border-box;overflow:hidden;background:#F0FDFA;border:1px solid #99F6E4;box-sizing:border-box"></div>
<div style="position:absolute;left:620px;top:58px;width:112px;height:18px;box-sizing:border-box;overflow:hidden;font-size:9px;font-weight:700;color:#0F172A;text-align:right;display:flex;align-items:center;justify-content:flex-end;white-space:pre-wrap">RX20261027-01</div>
<div style="position:absolute;left:560px;top:60px;width:60px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#0F766E;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">处方编号</div>
<div style="position:absolute;left:48px;top:74px;width:300px;height:34px;box-sizing:border-box;overflow:hidden;font-size:24px;font-weight:700;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">处 方 笺</div>
<div style="position:absolute;left:620px;top:86px;width:112px;height:18px;box-sizing:border-box;overflow:hidden;font-size:9px;color:#0F172A;text-align:right;display:flex;align-items:center;justify-content:flex-end;white-space:pre-wrap">2026-10-27</div>
<div style="position:absolute;left:560px;top:88px;width:60px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#0F766E;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">开单日期</div>
<div style="position:absolute;left:48px;top:112px;width:300px;height:14px;box-sizing:border-box;overflow:hidden;font-size:8px;color:#94A3B8;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">OUTPATIENT PRESCRIPTION</div>
<div style="position:absolute;left:48px;top:142px;width:698px;height:2px;box-sizing:border-box;overflow:hidden;background:#0F766E"></div>
<div style="position:absolute;left:48px;top:156px;width:698px;height:48px;box-sizing:border-box;overflow:hidden;background:#F8FAFC"></div>
<div style="position:absolute;left:104px;top:162px;width:120px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;font-weight:600;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">周雅琴</div>
<div style="position:absolute;left:292px;top:162px;width:60px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">女</div>
<div style="position:absolute;left:422px;top:162px;width:70px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">34 岁</div>
<div style="position:absolute;left:584px;top:162px;width:148px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;font-weight:600;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">呼吸内科</div>
<div style="position:absolute;left:62px;top:164px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">姓名</div>
<div style="position:absolute;left:250px;top:164px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">性别</div>
<div style="position:absolute;left:380px;top:164px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">年龄</div>
<div style="position:absolute;left:520px;top:164px;width:60px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">就诊科室</div>
<div style="position:absolute;left:104px;top:182px;width:160px;height:18px;box-sizing:border-box;overflow:hidden;font-size:9.5px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">MZ202610270036</div>
<div style="position:absolute;left:62px;top:184px;width:40px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#64748B;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">门诊号</div>
<div style="position:absolute;left:480px;top:184px;width:252px;height:14px;box-sizing:border-box;overflow:hidden;font-size:7.5px;color:#64748B;text-align:right;display:flex;align-items:center;justify-content:flex-end;white-space:pre-wrap">医保类型:城镇职工基本医疗保险</div>
<div style="position:absolute;left:110px;top:218px;width:300px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">急性上呼吸道感染</div>
<div style="position:absolute;left:490px;top:218px;width:242px;height:18px;box-sizing:border-box;overflow:hidden;font-size:10px;color:#B91C1C;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">青霉素过敏</div>
<div style="position:absolute;left:48px;top:220px;width:56px;height:16px;box-sizing:border-box;overflow:hidden;font-size:9px;font-weight:700;color:#0F766E;display:flex;align-items:center;justify-content:flex-start;white-space:pre-
// …
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.