使用 React-Konva 将 Konva-Canvas 转换为 PDF
你好,我已经实现了如何以 png 和 jpeg 格式保存画布,但我想将其保存为 pdf 我已经从这里看到了 JavaScript 代码:https://konvajs.org/docs/sandbox/Canvas_to_PDF.html 我想知道如何在React中实现 这是我的演示代码: https://codesandbox.io/s/react-canvas -n779q2?file=/src/App.js
Hello i have implemented on how to save the canvas in png and jpeg but i would like to save it into pdf i have seen the code for JavaScript from here:https://konvajs.org/docs/sandbox/Canvas_to_PDF.html
i would like to know how it can be implemented in React
here is my demo code:
https://codesandbox.io/s/react-canvas-n779q2?file=/src/App.js
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所需要的只是 Konva Stage 的参考。然后你可以这样做:
All you need is a reference to the Konva Stage. Then you can do: