简体   繁体   English

使用jsPDF在PDF模板上呈现动态数据

[英]Using jsPDF to render dynamic data on PDF template

Newbie here. 新手在这里。 I'm making an app that retrieves data from an API, makes some charts from these data (probably using d3.js) and then renders these charts and some dynamic text on a PDF template, generating a PDF doc that can then be downloaded by the user. 我正在制作一个应用程序,该应用程序从API检索数据,从这些数据中绘制一些图表(可能使用d3.js),然后在PDF模板上呈现这些图表和一些动态文本,生成一个PDF文档,然后可以通过用户。

I'm wondering if jsPDF can be used to fill in dynamic data on a pre-existing PDF template. 我想知道jsPDF是否可用于在预先存在的PDF模板上填写动态数据。 Most of the PDF document is static, and it's just a few dynamic charts that need to be added in, depending on what the user inputs. PDF文档的大多数是静态的,仅需要添加少量动态图表,具体取决于用户输入的内容。

All of what you ask can easily be done using XSL FO to generate the PDF, scraping the SVG from the application. 使用XSL FO生成PDF,从应用程序中抓取SVG即可轻松完成您所要求的所有操作。 Most XSL FO processors would also support stamping in the charts onto static PDFs or even generating the content of the pages dynamically. 大多数XSL FO处理器还支持在图表中标记到静态PDF上,甚至支持动态生成页面内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM