-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconverter-wo.js
21 lines (20 loc) · 974 Bytes
/
converter-wo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// cd H:\Projects\Tools\node-ocr
//
// node converter-wo.js 2 14 3_4 52
// node converter-wo.js series, volume, issue, number of pages
import ot from 'ocr-bulk';
ot.writeFile({
start: 1,
end: process.argv[5],
outputPath: __dirname + '/../../Bahai.works/English/World_Order/Series' + process.argv[2] + '/Volume' + process.argv[3] + '/World_Order2_Vol' + process.argv[3] + '_Issue' + process.argv[4] + '_text2.txt',
getImagePath (i) {
return 'H:\\Projects\\Bahai.works\\English\\World_Order\\Series' + process.argv[2] + '\\Volume' + process.argv[3] + '\\World_Order2_Vol' + process.argv[3] + '_Issue' + process.argv[4] + '_Page_' + ot.pad(i, 2) + '.png';
},
concatenater (text, i) {
console.log('Finishing ' + i);
return '{{page|' + (i-2) + '|file=World_Order2_Vol' + process.argv[3] + '_Issue' + process.argv[4] + '.pdf|page=' + i + '}}' + text;
},
done () {
console.log('Saved!');
}
});