Skip to content

Commit

Permalink
Switches to lib-unoconv (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Jun 6, 2018
1 parent 0cc2c80 commit b32071e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/convert-to-pdf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const uuid = require('uuid')
const unoconv = require('better-unoconv')
const unoconv = require('lib-unoconv')
const config = require('../config')
const deleteFile = require('./delete-file')
const saveFile = require('./save-file')
Expand All @@ -15,15 +15,15 @@ module.exports = document => {

unoconv.convert(fileName, 'pdf', { port: '2002' }, async (error, pdfFile) => {
if (error) {
logger('error', ['convert-docx-to-pdf', error])
logger('error', ['convert-to-pdf', error])
await deleteFile(fileName)
reject(error)
} else {
if (document.title) {
document.title = document.title.replace('.docx', '.pdf')
}
document.data = pdfFile.toString('base64')
logger('info', ['convert-docx-to-pdf', `Converted ${fileName} to ${document.title}`])
logger('info', ['convert-to-pdf', `Converted ${fileName} to ${document.title}`])
await deleteFile(fileName)
resolve(document)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"standard": "11.0.1"
},
"dependencies": {
"better-unoconv": "1.0.3",
"lib-unoconv": "0.1.2",
"uuid": "3.2.1",
"winston": "2.4.2",
"winston-papertrail": "1.0.5"
Expand Down

0 comments on commit b32071e

Please sign in to comment.