在线样例
左侧浏览样例目录,右侧查看版式预览与示例代码;点击运行即可通过 web-print-pdf 驱动本地客户端完成静默打印或 PDF 预览。使用前请先 安装并启动客户端。
客户端
若打印或预览效果与预期不符,请务必先从官网下载并安装最新版 Web打印专家客户端后再试(旧版本可能导致版式偏差)。
版式说明
版式预览与打印输出完全遵循 HTML/CSS 标准样式,没有隐藏的渲染技巧:样式写成什么样,页面就长成什么样。
13 - 圆通速递面单
圆通速递面单打印样例。
版式预览
示例代码
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: 567px;
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:0px;top:0px;width:378px;height:44px;box-sizing:border-box;overflow:hidden;background:#C8102E"></div>
<div style="position:absolute;left:12px;top:9px;width:180px;height:26px;box-sizing:border-box;overflow:hidden;font-size:15px;font-weight:700;color:#FFFFFF;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">圆通速递 YTO</div>
<div style="position:absolute;left:250px;top:13px;width:116px;height:18px;box-sizing:border-box;overflow:hidden;font-size:12px;font-weight:700;color:#FFFFFF;text-align:right;display:flex;align-items:center;justify-content:flex-end;white-space:pre-wrap">95554</div>
<div style="position:absolute;left:292px;top:48px;width:74px;height:74px;box-sizing:border-box;overflow:hidden;display:flex;align-items:center;justify-content:center"><svg width="74" height="74" viewBox="0 0 74 74" xmlns="http://www.w3.org/2000/svg"><rect x="0.00" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="20.18" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="33.64" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="60.55" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="67.27" y="0.00" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="26.91" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="40.36" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="60.55" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="67.27" y="6.73" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="33.64" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="47.09" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="60.55" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="67.27" y="13.45" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="20.18" width="6.73" height="6.73" fill="#111"/><rect x="20.18" y="20.18" width="6.73" height="6.73" fill="#111"/><rect x="40.36" y="20.18" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="20.18" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="26.91" width="6.73" height="6.73" fill="#111"/><rect x="26.91" y="26.91" width="6.73" height="6.73" fill="#111"/><rect x="47.09" y="26.91" width="6.73" height="6.73" fill="#111"/><rect x="60.55" y="26.91" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="33.64" width="6.73" height="6.73" fill="#111"/><rect x="20.18" y="33.64" width="6.73" height="6.73" fill="#111"/><rect x="33.64" y="33.64" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="33.64" width="6.73" height="6.73" fill="#111"/><rect x="67.27" y="33.64" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="40.36" width="6.73" height="6.73" fill="#111"/><rect x="26.91" y="40.36" width="6.73" height="6.73" fill="#111"/><rect x="40.36" y="40.36" width="6.73" height="6.73" fill="#111"/><rect x="60.55" y="40.36" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="47.09" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="47.09" width="6.73" height="6.73" fill="#111"/><rect x="33.64" y="47.09" width="6.73" height="6.73" fill="#111"/><rect x="47.09" y="47.09" width="6.73" height="6.73" fill="#111"/><rect x="67.27" y="47.09" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="53.82" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="53.82" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="53.82" width="6.73" height="6.73" fill="#111"/><rect x="20.18" y="53.82" width="6.73" height="6.73" fill="#111"/><rect x="40.36" y="53.82" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="53.82" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="60.55" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="60.55" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="60.55" width="6.73" height="6.73" fill="#111"/><rect x="26.91" y="60.55" width="6.73" height="6.73" fill="#111"/><rect x="47.09" y="60.55" width="6.73" height="6.73" fill="#111"/><rect x="60.55" y="60.55" width="6.73" height="6.73" fill="#111"/><rect x="0.00" y="67.27" width="6.73" height="6.73" fill="#111"/><rect x="6.73" y="67.27" width="6.73" height="6.73" fill="#111"/><rect x="13.45" y="67.27" width="6.73" height="6.73" fill="#111"/><rect x="20.18" y="67.27" width="6.73" height="6.73" fill="#111"/><rect x="33.64" y="67.27" width="6.73" height="6.73" fill="#111"/><rect x="53.82" y="67.27" width="6.73" height="6.73" fill="#111"/><rect x="67.27" y="67.27" width="6.73" height="6.73" fill="#111"/></svg></div>
<div style="position:absolute;left:52px;top:50px;width:170px;height:18px;box-sizing:border-box;overflow:hidden;font-size:12px;font-weight:700;color:#0F172A;display:flex;align-items:center;justify-content:flex-start;white-space:pre-wrap">YT4567890123456</div>
<div style="position:absolute;left:12px;top:52px;width:36px;height:12px;box-sizing:border-box;overflow:
// …
运行结果
- 若无法打印或连接客户端失败,请参阅 本地Print succeeded,上线后无法打印?(HTTP 业务系统上线后常见)。
- 客户端内置「运行示例」页(
vueApp/.../examples/index.vue)提供更多可编辑 demo,与本页样例互补。 - 工具类样例(连接检测、打印机列表等)仅返回 JSON,不触发打印。