[英]How can i generate a .ejs file to pdf in NODEJS with angularjs?
I am creating a project in nodejs with AngularJS and a MySQL database. 我正在使用AngularJS和MySQL数据库在nodejs中创建一个项目。 I want is to display information from the MYSQL table in a PDF, similar to a report.
我想要以PDF格式显示MYSQL表中的信息,类似于报告。
Can I render an .ejs with angular to pdf and the client only see the pdf with the information? 我可以将.ejs渲染成与pdf成角度的格式,客户端只能看到包含信息的pdf吗? Is there any way to do this?
有什么办法吗?
You could use https://www.npmjs.com/package/electron-pdf 您可以使用https://www.npmjs.com/package/electron-pdf
This library generates a PDF file from an URL, you can also use it from your express application: 该库从URL生成PDF文件,您也可以在快速应用程序中使用它:
var ElectronPDF = require('electron-pdf')
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
app.use(bodyParser.json())
var exporter = new ElectronPDF()
exporter.on('charged', () => {
//Only start the express server once the exporter is ready
app.listen(port, hostname, function() {
console.log(`Export Server running at http://${hostname}:${port}`);
})
})
exporter.start()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.