html tag
This commit is contained in:
@@ -8,8 +8,6 @@ async function makePdf(data) {
|
|||||||
let options = { format: 'A4' };
|
let options = { format: 'A4' };
|
||||||
let template = {
|
let template = {
|
||||||
content: `<!DOCTYPE html>
|
content: `<!DOCTYPE html>
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
// @media print {
|
// @media print {
|
||||||
@@ -244,7 +242,6 @@ async function makePdf(data) {
|
|||||||
</html>` };
|
</html>` };
|
||||||
|
|
||||||
html_to_pdf.generatePdf(template, options).then(pdfBuffer => {
|
html_to_pdf.generatePdf(template, options).then(pdfBuffer => {
|
||||||
// console.log("PDF Buffer:-", pdfBuffer);
|
|
||||||
fs.writeFile(`reports/${data._id}.pdf`, pdfBuffer, "binary", function (err) {
|
fs.writeFile(`reports/${data._id}.pdf`, pdfBuffer, "binary", function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -266,10 +263,6 @@ fs.createReadStream("data/result.csv")
|
|||||||
.on('data', function(data){
|
.on('data', function(data){
|
||||||
try {
|
try {
|
||||||
console.log("id: " + data._id);
|
console.log("id: " + data._id);
|
||||||
// console.log("Age is: "+data.Age);
|
|
||||||
|
|
||||||
//perform the operation
|
|
||||||
|
|
||||||
users.push(data);
|
users.push(data);
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
@@ -277,7 +270,6 @@ fs.createReadStream("data/result.csv")
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('end', async function(){
|
.on('end', async function(){
|
||||||
//some final operation
|
|
||||||
console.log('size ', users.length);
|
console.log('size ', users.length);
|
||||||
|
|
||||||
for (let i = 0; i < users.length; i++) {
|
for (let i = 0; i < users.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user