Tag: jasper reports

Node.js将二进制文件转换为utf8

我有一个二进制格式(bytea)存储在postgresql数据库中的jrmxl(Jasper报告)文件。 我试图读取该文件,并将其转换为普通的jrmxl(XML)文件并将其保存在磁盘上。 这是我迄今为止所尝试的 var fs = require('fs'); exports.saveFile = function (pg) { //pg is the postgres connection to query the db pg.query('Select data from data_file where id = 123', function (err, result) { if (err) { console.log(err); return; } var data = result.rows[0].data; //Buffer.isBuffer(data) === true // I can get the data here. Now I […]