Skip to content

服务端生成sv-print, vue-plugin-hiprint打印模板图片, pdf, html. 用于小程序或非web环境预览模板

License

Notifications You must be signed in to change notification settings

CcSimple/node-hiprint-pdf

Repository files navigation

node hiprint pdf/image server

Node server for generating vue-plugin-hiprint print templates in HTML, PDF, image . .

framework

run

# 1
git clone https://github.com/CcSimple/node-hiprint-pdf.git
# 2
cd node-hiprint-pdf
# 3
npm i --registry https://registry.npmmirror.com
# 4
npm run start

docker

docker compose up -d

api

type api desc options
POST /img image {template:{}, printData:{}, options:{}, url:'', noFile: false}
POST /pdf pdf {template:{}, printData:{}, options:{}, url:'', noFile: false}
POST /html html {template:{}, printData:{}, options:{}, url:'', domId: '#hiprintTemplate', noFile: false}

options

example

import axios from "axios";
import template from "./template";
import printData from "./printData";

// pdf
axios.post("/pdf", {
  template,
  printData,
});

// img
axios.post("/img", {
  template,
  printData,
});

// html
axios.post("/html", {
  template,
  printData,
  domId: "#hiprintTemplate", // 获取指定节点的 html
});

在线体验

2C4G 服务器,性能较弱.若无法正常访问,可以查看文章,获取 demo 源码.

https://mp.weixin.qq.com/s/a5JnxKnA7a4QVAyeCmBKbA

i不简

都看到这里了,点个 star 吧!

di~

ww.png

About

服务端生成sv-print, vue-plugin-hiprint打印模板图片, pdf, html. 用于小程序或非web环境预览模板

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published