Hi,
Im new programming with nodejs and Im tryin to create some PDF Documents from a Browser request.

The thing is I would like to have the three paragraphs in the same PDF separateley with a line break. But it semms my code just add a comma (,) between each paragraph... I have inspected the PDFKit module, and I couldnt find where this coma comes from. Can somebody help me?
This is my code:
`
const express = require('express');
const router = express.Router();
const PDFDocument = require('pdfkit');
router.get('/', function(req, res, next) {
res.render('pdf', {
title: 'Steps',
text: 'Express'
});
});
router.post('/', function(req, res) {
var doc = new PDFDocument();
var filename = req.body.filename;
filename = encodeURIComponent(filename) + '.pdf';
res.setHeader('Content-disposition', 'attachment; filename="' + filename + '"');
res.setHeader('Content-type', 'application/pdf');
var content = [req.body.content];
for(i = 0; i < content.length; i++ ) {
doc.y = 300;
doc.text(content[i], 50, 50);
}
doc.pipe(res);
doc.end();
});
module.exports = router;
麓
and this is the html:
`
`
HI, I think you have to add
doc.moveDown() Inside the loop for!
Like this:
for(i = 0; i < content.length; i++ ) {
doc.y = 300;
doc.text(content[i], 50, 50);
doc.moveDown()
}
Hi, thanks for your answer. I try that method but it seems to be IntelliJ can not recognize that method and Im getting the same PDF as before.

Any ideas why? Im using WebStorm 2017.1
I麓ve just resolve why Webstorm couldn麓t recognize the mothod moveDown(), pdfkit was not in the file package.json in my project.
I tried again with this method, but I still get my paragraphs separated by a comma. I dont know if it a standard setting... Any suggestions?
Sorry, I can't help you with Webstorm, I don't use it!
Most helpful comment
HI, I think you have to add
doc.moveDown()Inside the loop for!Like this: