-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
dev.ts
30 lines (24 loc) · 742 Bytes
/
dev.ts
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
import Automizer from './index';
const run = async () => {
const outputDir = `${__dirname}/../__tests__/pptx-output`;
const templateDir = `${__dirname}/../__tests__/pptx-templates`;
const automizer = new Automizer({
templateDir,
outputDir,
autoImportSlideMasters: true,
cleanupPlaceholders: true,
});
let pres = automizer
.loadRoot(`RootTemplate.pptx`)
.load(`EmptySlidePlaceholders.pptx`, 'placeholder')
.load(`EmptySlide.pptx`, 'emptySlide');
pres.addSlide('emptySlide', 1, (slide) => {
slide.addElement('placeholder', 1, 'Titel 4');
});
pres.write(`myOutputPresentation.pptx`).then((summary) => {
console.log(summary);
});
};
run().catch((error) => {
console.error(error);
});