forked from kriskbx/gitlab-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdf.js
More file actions
executable file
·25 lines (20 loc) · 717 Bytes
/
pdf.js
File metadata and controls
executable file
·25 lines (20 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const fs = require('fs');
const markdownpdf = require('markdown-pdf');
const markdown = require('./markdown');
const Cli = require('./../include/cli');
class pdf extends markdown {
toFile(file, resolve, style = 'default') {
if (fs.existsSync(file)) fs.unlinkSync(file);
markdownpdf({
paperFormat: 'A4',
paperOrientation: 'landscape',
paperBorder: '1cm',
cssPath: `${__dirname}/styles/layout/${style}.css`,
highlightCssPath: `${__dirname}/styles/highlight/${style}.css`
}).from.string(this.out).to(file, () => resolve());
}
toStdOut() {
Cli.error(`Can't output pdf to std out`);
}
}
module.exports = pdf;