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

查看:681
本文介绍了使用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天全站免登陆