-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdf.js
39 lines (31 loc) · 995 Bytes
/
pdf.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*jshint esversion: 6 */
/* global __dirname, process */
(function() {
'use strict';
const util = require('util');
const DataExtractorFactory = require(__dirname + '/extract/data-extractor-factory');
const Promise = require('bluebird');
const options = require(__dirname + '/options/pdf');
const winston = require('winston');
const moment = require('moment');
if (!options.isOk()) {
options.printUsage();
process.exitCode = 1;
return;
}
winston.level = 'debug';
const errorLog = options.getOption("error-log");
if (errorLog) {
winston.add(winston.transports.File, { filename: errorLog });
winston.remove(winston.transports.Console);
}
const extractor = DataExtractorFactory.createDataExtractor(options.getOption('source'));
extractor.extractPdfEventActionContents(options)
.then(() => {
console.log("Done.");
})
.catch((err) => {
console.error(err);
process.exitCode = 1;
});
}).call(this);