diff --git a/README.md b/README.md index d6748e0..cc503ce 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,39 @@ # WV2PDF -WebView2 Create PDF -# build -``` -set PYTHONIOENCODING=utf-8 -set PYTHONUTF8=1 -node-gyp configure -node-gyp build +Use WebView2 to Create PDF + +# Download + + [Releases](https://github.com/xland/WV2PDF/releases) + +# Usage +- Download [Service.exe](https://github.com/xland/WV2PDF/releases) +- Start Service.exe +- Then connect Service + +```javascript +const WebSocket = require("ws"); +const ws = new WebSocket(`ws://127.0.0.1:8080`); +let objs = [ + { url: "https://www.baidu.com" }, + { url: "https://www.cnblogs.com" }, + { url: "https://www.csdn.net" }, + { url: "https://www.oschina.net" } +]; +ws.on("open", () => { + console.log("connected"); + for (let obj of objs) { + ws.send(JSON.stringify(obj)); + } +}); +ws.on("message", (data) => { + let obj = JSON.parse(data.toString()); + console.log("receive msg:", obj); +}); + +ws.on("close", () => console.log("conn closed")); +ws.on("error", (err) => console.error("error:", err)); +``` -https://github.com/mutouyun/cpp-ipc -``` \ No newline at end of file +- The PDF file will be created in the current directory \ No newline at end of file