使用 jsPDF 在服务器端保存 pdf [英] Saving pdf on server side with jsPDF

查看:47
本文介绍了使用 jsPDF 在服务器端保存 pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序可以生成一个 HTML 页面,其中包含用户可以编辑的数据.最后我用 jsPDF 生成了一个 .pdf 文件.有什么办法可以将这个生成的 .pdf 保存在我的服务器端数据库中?

I have an application that generates a HTML page with data which the user can edit. At the end I generate a .pdf file with jsPDF. Is there any way that I can save this generated .pdf on my server-side database?

我正在使用 PrimeFaces.

I'm using PrimeFaces.

提前致谢

推荐答案

为其他用户更新我的解决方案:

Updating my solution for other users:

我找到了 jsPDF 的 .output('datauristring') 方法,它返回一个 BASE64 字符串.

I found the .output('datauristring') method of the jsPDF which returns me a BASE64 String.

然后字符串通过 JSON 发送到我支持的 bean 并按照我的意愿进行转换.

Then the String is sent via JSON to my backed bean and converted as my will.

这篇关于使用 jsPDF 在服务器端保存 pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆