Merge branch 'master' into DepauMD
This commit is contained in:
commit
f725ebd369
1 changed files with 4 additions and 0 deletions
|
@ -341,6 +341,10 @@ function actionPDF (req, res, note) {
|
|||
var path = config.tmpPath + '/' + Date.now() + '.pdf'
|
||||
content = content.replace(/\]\(\//g, '](' + url + '/')
|
||||
markdownpdf().from.string(content).to(path, function () {
|
||||
if (!fs.existsSync(path)) {
|
||||
logger.error('PDF seems to not be generated as expected. File doesn\'t exist: ' + path)
|
||||
return response.errorInternalError(res)
|
||||
}
|
||||
var stream = fs.createReadStream(path)
|
||||
var filename = title
|
||||
// Be careful of special characters
|
||||
|
|
Loading…
Reference in a new issue